VectorTile source projection has to match the view projection
This commit is contained in:
+5
-1
@@ -248,4 +248,8 @@ This is done by providing adequate shaders using the `hitVertexShader` and `hitF
|
|||||||
|
|
||||||
### 67
|
### 67
|
||||||
|
|
||||||
A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both.
|
A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both.
|
||||||
|
|
||||||
|
### 68
|
||||||
|
|
||||||
|
A VectorTile source can only be rendered if it has a projection compatible with the view projection.
|
||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
scale as scaleTransform,
|
scale as scaleTransform,
|
||||||
translate as translateTransform,
|
translate as translateTransform,
|
||||||
} from '../../transform.js';
|
} from '../../transform.js';
|
||||||
|
import {assert} from '../../asserts.js';
|
||||||
import {
|
import {
|
||||||
buffer,
|
buffer,
|
||||||
containsCoordinate,
|
containsCoordinate,
|
||||||
@@ -34,6 +35,7 @@ import {
|
|||||||
createHitDetectionImageData,
|
createHitDetectionImageData,
|
||||||
hitDetect,
|
hitDetect,
|
||||||
} from '../../render/canvas/hitdetect.js';
|
} from '../../render/canvas/hitdetect.js';
|
||||||
|
import {equivalent} from '../../proj.js';
|
||||||
import {
|
import {
|
||||||
getSquaredTolerance as getSquaredRenderTolerance,
|
getSquaredTolerance as getSquaredRenderTolerance,
|
||||||
renderFeature,
|
renderFeature,
|
||||||
@@ -230,7 +232,15 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
* @return {boolean} Layer is ready to be rendered.
|
* @return {boolean} Layer is ready to be rendered.
|
||||||
*/
|
*/
|
||||||
prepareFrame(frameState) {
|
prepareFrame(frameState) {
|
||||||
const layerRevision = this.getLayer().getRevision();
|
const layer = this.getLayer();
|
||||||
|
assert(
|
||||||
|
equivalent(
|
||||||
|
layer.getSource().getProjection(),
|
||||||
|
frameState.viewState.projection
|
||||||
|
),
|
||||||
|
68 // A VectorTile source can only be rendered if it has a projection compatible with the view projection.
|
||||||
|
);
|
||||||
|
const layerRevision = layer.getRevision();
|
||||||
if (this.renderedLayerRevision_ != layerRevision) {
|
if (this.renderedLayerRevision_ != layerRevision) {
|
||||||
this.renderedTiles.length = 0;
|
this.renderedTiles.length = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user