ol 10.6.2-dev.1760977773143 → 10.6.2-dev.1761509477559
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MapBrowserEvent.d.ts +1 -1
- package/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/render/webgl/constants.d.ts +1 -1
- package/render/webgl/constants.d.ts.map +1 -1
- package/render/webgl/constants.js +1 -1
- package/renderer/canvas/VectorTileLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorTileLayer.js +27 -3
- package/reproj/DataTile.d.ts.map +1 -1
- package/reproj/DataTile.js +3 -1
- package/source/VectorTile.d.ts +2 -2
- package/source/VectorTile.d.ts.map +1 -1
- package/source/VectorTile.js +76 -19
- package/util.js +1 -1
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export type WebGLWorkerGenerateBuffersMessage = {
|
|
|
22
22
|
/**
|
|
23
23
|
* render instructions raw binary buffer.
|
|
24
24
|
*/
|
|
25
|
-
renderInstructions:
|
|
25
|
+
renderInstructions: ArrayBufferLike;
|
|
26
26
|
/**
|
|
27
27
|
* Amount of hit detection + custom attributes count in the render instructions.
|
|
28
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":"qCAKU,MAAM;;;;;;;;;;;;;;;;QAcF,MAAM;;;;UACN,sBAAsB;;;;wBACtB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":"qCAKU,MAAM;;;;;;;;;;;;;;;;QAcF,MAAM;;;;UACN,sBAAsB;;;;wBACtB,eAAe"}
|
|
@@ -19,7 +19,7 @@ export const WebGLWorkerMessageType = {
|
|
|
19
19
|
* Note that any addition properties present in the message *will* be sent back to the main thread.
|
|
20
20
|
* @property {number} id Message id; will be used both in request and response as a means of identification
|
|
21
21
|
* @property {WebGLWorkerMessageType} type Message type
|
|
22
|
-
* @property {
|
|
22
|
+
* @property {ArrayBufferLike} renderInstructions render instructions raw binary buffer.
|
|
23
23
|
* @property {number} [customAttributesSize] Amount of hit detection + custom attributes count in the render instructions.
|
|
24
24
|
* @property {ArrayBuffer} [indicesBuffer] Indices array raw binary buffer (sent by the worker).
|
|
25
25
|
* @property {ArrayBuffer} [vertexAttributesBuffer] Vertex attributes array raw binary buffer (sent by the worker).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorTileLayer.d.ts","sourceRoot":"","sources":["VectorTileLayer.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"VectorTileLayer.d.ts","sourceRoot":"","sources":["VectorTileLayer.js"],"names":[],"mappings":";AA6DA;;;;;GAKG;AACH;IACE;;;OAGG;IACH,mBAHW,OAAO,2BAA2B,EAAE,OAAO,WAC3C,OAAO,gBAAgB,EAAE,OAAO,EA2C1C;IAtCC,eAAe;IACf,qCAA2E;IAE3E;;;OAGG;IACH,+BAA2B;IAE3B;;;OAGG;IACH,4CAA+C;IAE/C;;;OAGG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,yBAAyB;IAEzB;;;OAGG;IACH,sBAAsC;IAEtC;;;OAGG;IACH,0BAA6B;IAY/B;;;;;;;;;;OAUG;IACH,wBAVW,OAAO,2BAA2B,EAAE,OAAO,cAC3C,OAAO,cAAc,EAAE,UAAU,KACjC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,UACN,MAAM,cACN,OAAO,QAajB;IAoDD;;;;;OAKG;IACH,6BA4IC;IAyMD;;;OAGG;IACH,4BAHW,OAAO,iBAAiB,EAAE,MAAM,GAC/B,KAAK,CAAC,OAAO,kBAAkB,EAAE,WAAW,CAAC,CA4CxD;IAaD;;;;OAIG;IACH,gCAEC;IAED;;;;OAIG;IACH,4BAHW,OAAO,cAAc,EAAE,UAAU,cACjC,OAAO,sBAAsB,EAAE,KAAK,QAyC9C;IA6DD;;;;OAIG;IACH,6BAJW,OAAO,2BAA2B,EAAE,OAAO,cAC3C,OAAO,cAAc,EAAE,UAAU,GAChC,OAAO,oBAAoB,EAAE,SAAS,CAkCjD;IAqID;;;;;;;;OAQG;IACH,uBARW,OAAO,kBAAkB,EAAE,WAAW,oBACtC,MAAM,UACN,OAAO,sBAAsB,EAAE,OAAO,GAAC,KAAK,CAAC,OAAO,sBAAsB,EAAE,OAAO,CAAC,gBACpF,OAAO,qCAAqC,EAAE,OAAO,cACrD,OAAO,UACP,MAAM,GACL,OAAO,CAyClB;IAED;;;;OAIG;IACH,8BAcC;IAED;;;;OAIG;IACH,yBAwDC;CACF;oCAl9BmC,gBAAgB"}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
getTopLeft,
|
|
15
15
|
intersects,
|
|
16
16
|
} from '../../extent.js';
|
|
17
|
+
import {equivalent, getTransform, transformExtent} from '../../proj.js';
|
|
17
18
|
import CanvasBuilderGroup from '../../render/canvas/BuilderGroup.js';
|
|
18
19
|
import CanvasExecutorGroup, {
|
|
19
20
|
DECLUTTER,
|
|
@@ -234,9 +235,22 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|
|
234
235
|
if (sourceTile.getState() != TileState.LOADED) {
|
|
235
236
|
continue;
|
|
236
237
|
}
|
|
238
|
+
const sourceProjection = source.getProjection();
|
|
237
239
|
const sourceTileCoord = sourceTile.tileCoord;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
let sourceTileExtent = sourceTileGrid.getTileCoordExtent(sourceTileCoord);
|
|
241
|
+
if (
|
|
242
|
+
projection &&
|
|
243
|
+
sourceProjection &&
|
|
244
|
+
!equivalent(projection, sourceProjection)
|
|
245
|
+
) {
|
|
246
|
+
sourceTileExtent = transformExtent(
|
|
247
|
+
sourceTileExtent,
|
|
248
|
+
sourceProjection,
|
|
249
|
+
projection,
|
|
250
|
+
32,
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
240
254
|
const sharedExtent = getIntersection(tileExtent, sourceTileExtent);
|
|
241
255
|
const builderExtent = buffer(
|
|
242
256
|
sharedExtent,
|
|
@@ -287,7 +301,17 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|
|
287
301
|
features.sort(renderOrder);
|
|
288
302
|
}
|
|
289
303
|
for (let i = 0, ii = features.length; i < ii; ++i) {
|
|
290
|
-
|
|
304
|
+
let feature = features[i];
|
|
305
|
+
if (
|
|
306
|
+
projection &&
|
|
307
|
+
sourceTile.projection &&
|
|
308
|
+
!equivalent(projection, sourceTile.projection)
|
|
309
|
+
) {
|
|
310
|
+
feature = feature.clone();
|
|
311
|
+
feature
|
|
312
|
+
.getGeometry()
|
|
313
|
+
.applyTransform(getTransform(sourceTile.projection, projection));
|
|
314
|
+
}
|
|
291
315
|
if (
|
|
292
316
|
!bufferedExtent ||
|
|
293
317
|
intersects(bufferedExtent, feature.getGeometry().getExtent())
|
package/reproj/DataTile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTile.d.ts","sourceRoot":"","sources":["DataTile.js"],"names":[],"mappings":";yBAsBa,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAI,OAAO,gBAAgB,EAAE,OAAO;;;;;UAK1E,QAAQ;;;;YACR,MAAM;;;;;;gBAKN,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;gBACzC,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;eACzC,OAAO,iBAAiB,EAAE,SAAS;;;;;;;;gBAEnC,MAAM;;;;YACN,MAAM;;;;qBACN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;AApBxB;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;GAKG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAiOjB;IAvNC;;;OAGG;IACH,qBACiE;IAEjE;;;OAGG;IACH,oBAAqC;IAErC;;;OAGG;IACH,gBAA6B;IAE7B;;;OAGG;IACH,oBAAuB;IAEvB;;;OAGG;IACH,qBAAwB;IAExB;;;OAGG;IACH,oBAA4B;IAE5B;;;OAGG;IACH,wBAA6C;IAE7C;;;OAGG;IACH,wBAA6C;IAE7C;;;OAGG;IACH,0BAAsE;IAEtE;;;OAGG;IACH,qBAAsB;IAEtB;;;OAGG;IACH,6BAAgC;IAEhC;;;OAGG;IACH,iBAAiB;IAMjB;;;OAGG;IACH,oBAIwB;IAmDxB;;;OAGG;IACH,uBAQC;IAgGH;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"DataTile.d.ts","sourceRoot":"","sources":["DataTile.js"],"names":[],"mappings":";yBAsBa,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAI,OAAO,gBAAgB,EAAE,OAAO;;;;;UAK1E,QAAQ;;;;YACR,MAAM;;;;;;gBAKN,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;gBACzC,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;eACzC,OAAO,iBAAiB,EAAE,SAAS;;;;;;;;gBAEnC,MAAM;;;;YACN,MAAM;;;;qBACN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;AApBxB;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;GAKG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAiOjB;IAvNC;;;OAGG;IACH,qBACiE;IAEjE;;;OAGG;IACH,oBAAqC;IAErC;;;OAGG;IACH,gBAA6B;IAE7B;;;OAGG;IACH,oBAAuB;IAEvB;;;OAGG;IACH,qBAAwB;IAExB;;;OAGG;IACH,oBAA4B;IAE5B;;;OAGG;IACH,wBAA6C;IAE7C;;;OAGG;IACH,wBAA6C;IAE7C;;;OAGG;IACH,0BAAsE;IAEtE;;;OAGG;IACH,qBAAsB;IAEtB;;;OAGG;IACH,6BAAgC;IAEhC;;;OAGG;IACH,iBAAiB;IAMjB;;;OAGG;IACH,oBAIwB;IAmDxB;;;OAGG;IACH,uBAQC;IAgGH;;OAEG;IACH,mBAyMC;IAqDD;;OAEG;IACH,yBAGC;CACF;qBA7jByD,gBAAgB"}
|
package/reproj/DataTile.js
CHANGED
|
@@ -339,7 +339,9 @@ class ReprojDataTile extends DataTile {
|
|
|
339
339
|
const isFloat = tileData instanceof Float32Array;
|
|
340
340
|
const pixelCount = pixelSize[0] * pixelSize[1];
|
|
341
341
|
const DataType = isFloat ? Float32Array : Uint8ClampedArray;
|
|
342
|
-
const tileDataR = new DataType(
|
|
342
|
+
const tileDataR = new DataType(
|
|
343
|
+
/** @type {ArrayBuffer} */ (tileData.buffer),
|
|
344
|
+
);
|
|
343
345
|
const bytesPerElement = DataType.BYTES_PER_ELEMENT;
|
|
344
346
|
const bytesPerPixel = (bytesPerElement * tileDataR.length) / pixelCount;
|
|
345
347
|
const bytesPerRow = tileDataR.byteLength / pixelSize[1];
|
package/source/VectorTile.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type Options<FeatureType extends import("../Feature.js").FeatureLike = im
|
|
|
35
35
|
*/
|
|
36
36
|
overlaps?: boolean | undefined;
|
|
37
37
|
/**
|
|
38
|
-
* Projection of the tile
|
|
38
|
+
* Projection of the tile source.
|
|
39
39
|
*/
|
|
40
40
|
projection?: import("../proj.js").ProjectionLike;
|
|
41
41
|
/**
|
|
@@ -142,7 +142,7 @@ export type Options<FeatureType extends import("../Feature.js").FeatureLike = im
|
|
|
142
142
|
* to `false` (e.g. for sources with polygons that represent administrative
|
|
143
143
|
* boundaries or TopoJSON sources) allows the renderer to optimise fill and
|
|
144
144
|
* stroke operations.
|
|
145
|
-
* @property {import("../proj.js").ProjectionLike} [projection='EPSG:3857'] Projection of the tile
|
|
145
|
+
* @property {import("../proj.js").ProjectionLike} [projection='EPSG:3857'] Projection of the tile source.
|
|
146
146
|
* @property {import("./Source.js").State} [state] Source state.
|
|
147
147
|
* @property {typeof import("../VectorTile.js").default} [tileClass] Class used to instantiate tiles.
|
|
148
148
|
* Default is {@link module:ol/VectorTile~VectorTile}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorTile.d.ts","sourceRoot":"","sources":["VectorTile.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VectorTile.d.ts","sourceRoot":"","sources":["VectorTile.js"],"names":[],"mappings":"AAgfA;;;;;GAKG;AACH,oCAJoD,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY,iDACvC,OAAO,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAAC,OAC/C,MAAM,QAqBhB;;oBA9emD,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWpC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAZjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH;;;;;;;;;;;;;GAaG;AACH,yBAFoD,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;IAGhD;;OAEG;IACH,qBAFY,OAAO,CAAC,WAAW,CAAC,EAsE/B;IAlCC;;;OAGG;IACH,gBAAqD;IAErD;;;OAGG;IACH,iCAAkC;IAElC;;OAEG;IACH;;MAAsB;IAEtB;;;OAGG;IACH,kBAAwE;IAExE;;;OAGG;IACH,iCAA6D;IAE7D;;;OAGG;IACH,mBAAoB;IAGtB;;OAEG;IACH,eAFY,OAAO,CAIlB;IAED;;;;;OAKG;IACH,2BALW,MAAM,cACN,OAAO,oBAAoB,EAAE,OAAO,QACpC,gBAAgB,GACf,KAAK,CAAC,SAA+B,CAAC,CAmHjD;IAED;;OAEG;IACH,wBAFW,gBAAgB,QAqB1B;IAED;;;;;;;;OAQG;IACH,oBARW,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,GACrC,gBAAgB,CA2E5B;IAwED;;OAEG;IACH,sBAFW,OAAO,QAKjB;CACF;iBAtegB,kBAAkB;qBAWd,yBAAyB;oBAO1B,cAAc;6BAnBL,wBAAwB"}
|
package/source/VectorTile.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import TileState from '../TileState.js';
|
|
6
6
|
import VectorRenderTile from '../VectorRenderTile.js';
|
|
7
7
|
import Tile from '../VectorTile.js';
|
|
8
|
-
import {assert} from '../asserts.js';
|
|
9
8
|
import EventType from '../events/EventType.js';
|
|
10
9
|
import {
|
|
11
10
|
buffer as bufferExtent,
|
|
@@ -14,11 +13,15 @@ import {
|
|
|
14
13
|
} from '../extent.js';
|
|
15
14
|
import {loadFeaturesXhr} from '../featureloader.js';
|
|
16
15
|
import {isEmpty} from '../obj.js';
|
|
17
|
-
import {equivalent} from '../proj.js';
|
|
16
|
+
import {equivalent, transformExtent} from '../proj.js';
|
|
18
17
|
import {toSize} from '../size.js';
|
|
19
18
|
import TileGrid from '../tilegrid/TileGrid.js';
|
|
20
19
|
import {DEFAULT_MAX_ZOOM} from '../tilegrid/common.js';
|
|
21
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
createXYZ,
|
|
22
|
+
extentFromProjection,
|
|
23
|
+
getForProjection,
|
|
24
|
+
} from '../tilegrid.js';
|
|
22
25
|
import UrlTile from './UrlTile.js';
|
|
23
26
|
|
|
24
27
|
/**
|
|
@@ -33,7 +36,7 @@ import UrlTile from './UrlTile.js';
|
|
|
33
36
|
* to `false` (e.g. for sources with polygons that represent administrative
|
|
34
37
|
* boundaries or TopoJSON sources) allows the renderer to optimise fill and
|
|
35
38
|
* stroke operations.
|
|
36
|
-
* @property {import("../proj.js").ProjectionLike} [projection='EPSG:3857'] Projection of the tile
|
|
39
|
+
* @property {import("../proj.js").ProjectionLike} [projection='EPSG:3857'] Projection of the tile source.
|
|
37
40
|
* @property {import("./Source.js").State} [state] Source state.
|
|
38
41
|
* @property {typeof import("../VectorTile.js").default} [tileClass] Class used to instantiate tiles.
|
|
39
42
|
* Default is {@link module:ol/VectorTile~VectorTile}.
|
|
@@ -193,18 +196,37 @@ class VectorTile extends UrlTile {
|
|
|
193
196
|
tile.setState(TileState.LOADING);
|
|
194
197
|
const urlTileCoord = tile.wrappedTileCoord;
|
|
195
198
|
const tileGrid = this.getTileGridForProjection(projection);
|
|
196
|
-
|
|
199
|
+
let extent = tileGrid.getTileCoordExtent(urlTileCoord);
|
|
197
200
|
const z = urlTileCoord[0];
|
|
198
201
|
const resolution = tileGrid.getResolution(z);
|
|
199
202
|
// make extent 1 pixel smaller so we don't load tiles for < 0.5 pixel render space
|
|
200
203
|
bufferExtent(extent, -resolution, extent);
|
|
204
|
+
const sourceProjection = this.projection;
|
|
205
|
+
if (
|
|
206
|
+
projection &&
|
|
207
|
+
this.projection &&
|
|
208
|
+
!equivalent(projection, sourceProjection)
|
|
209
|
+
) {
|
|
210
|
+
extent = transformExtent(extent, projection, sourceProjection);
|
|
211
|
+
}
|
|
201
212
|
const sourceTileGrid = this.tileGrid;
|
|
202
213
|
const sourceExtent = sourceTileGrid.getExtent();
|
|
203
214
|
if (sourceExtent) {
|
|
204
215
|
getIntersection(extent, sourceExtent, extent);
|
|
205
216
|
}
|
|
217
|
+
let sourceResolution = resolution;
|
|
218
|
+
if (
|
|
219
|
+
projection &&
|
|
220
|
+
sourceProjection &&
|
|
221
|
+
!equivalent(projection, sourceProjection)
|
|
222
|
+
) {
|
|
223
|
+
sourceResolution =
|
|
224
|
+
resolution /
|
|
225
|
+
sourceProjection.getMetersPerUnit() /
|
|
226
|
+
projection.getMetersPerUnit();
|
|
227
|
+
}
|
|
206
228
|
const sourceZ = sourceTileGrid.getZForResolution(
|
|
207
|
-
|
|
229
|
+
sourceResolution,
|
|
208
230
|
this.zDirection,
|
|
209
231
|
);
|
|
210
232
|
|
|
@@ -263,7 +285,7 @@ class VectorTile extends UrlTile {
|
|
|
263
285
|
if (sourceTileState === TileState.IDLE) {
|
|
264
286
|
sourceTile.extent =
|
|
265
287
|
sourceTileGrid.getTileCoordExtent(sourceTileCoord);
|
|
266
|
-
sourceTile.projection = projection;
|
|
288
|
+
sourceTile.projection = this.projection;
|
|
267
289
|
sourceTile.resolution = sourceTileGrid.getResolution(
|
|
268
290
|
sourceTileCoord[0],
|
|
269
291
|
);
|
|
@@ -324,12 +346,22 @@ class VectorTile extends UrlTile {
|
|
|
324
346
|
projection,
|
|
325
347
|
);
|
|
326
348
|
const sourceExtent = this.getTileGrid().getExtent();
|
|
349
|
+
const sourceProjection = this.projection;
|
|
327
350
|
const tileGrid = this.getTileGridForProjection(projection);
|
|
328
351
|
if (urlTileCoord && sourceExtent) {
|
|
329
352
|
const tileExtent = tileGrid.getTileCoordExtent(urlTileCoord);
|
|
330
353
|
// make extent 1 pixel smaller so we don't load tiles for < 0.5 pixel render space
|
|
331
354
|
bufferExtent(tileExtent, -tileGrid.getResolution(z), tileExtent);
|
|
332
|
-
if (
|
|
355
|
+
if (
|
|
356
|
+
!intersects(
|
|
357
|
+
sourceExtent,
|
|
358
|
+
!projection ||
|
|
359
|
+
!sourceProjection ||
|
|
360
|
+
equivalent(projection, sourceProjection)
|
|
361
|
+
? tileExtent
|
|
362
|
+
: transformExtent(tileExtent, projection, sourceProjection),
|
|
363
|
+
)
|
|
364
|
+
) {
|
|
333
365
|
urlTileCoord = null;
|
|
334
366
|
}
|
|
335
367
|
}
|
|
@@ -337,15 +369,38 @@ class VectorTile extends UrlTile {
|
|
|
337
369
|
if (urlTileCoord !== null) {
|
|
338
370
|
const sourceTileGrid = this.tileGrid;
|
|
339
371
|
const resolution = tileGrid.getResolution(z);
|
|
340
|
-
|
|
372
|
+
let sourceResolution = resolution;
|
|
373
|
+
if (
|
|
374
|
+
projection &&
|
|
375
|
+
sourceProjection &&
|
|
376
|
+
!equivalent(projection, sourceProjection)
|
|
377
|
+
) {
|
|
378
|
+
sourceResolution =
|
|
379
|
+
resolution /
|
|
380
|
+
sourceProjection.getMetersPerUnit() /
|
|
381
|
+
projection.getMetersPerUnit();
|
|
382
|
+
}
|
|
383
|
+
const sourceZ = sourceTileGrid.getZForResolution(sourceResolution, 1);
|
|
341
384
|
// make extent 1 pixel smaller so we don't load tiles for < 0.5 pixel render space
|
|
342
385
|
const extent = tileGrid.getTileCoordExtent(urlTileCoord);
|
|
343
386
|
bufferExtent(extent, -resolution, extent);
|
|
344
|
-
sourceTileGrid.forEachTileCoord(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
387
|
+
sourceTileGrid.forEachTileCoord(
|
|
388
|
+
!projection ||
|
|
389
|
+
!sourceProjection ||
|
|
390
|
+
equivalent(projection, sourceProjection)
|
|
391
|
+
? extent
|
|
392
|
+
: transformExtent(extent, projection, sourceProjection),
|
|
393
|
+
sourceZ,
|
|
394
|
+
(sourceTileCoord) => {
|
|
395
|
+
empty =
|
|
396
|
+
empty &&
|
|
397
|
+
!this.tileUrlFunction(
|
|
398
|
+
sourceTileCoord,
|
|
399
|
+
pixelRatio,
|
|
400
|
+
sourceProjection,
|
|
401
|
+
);
|
|
402
|
+
},
|
|
403
|
+
);
|
|
349
404
|
}
|
|
350
405
|
const newTile = new VectorRenderTile(
|
|
351
406
|
tileCoord,
|
|
@@ -367,11 +422,13 @@ class VectorTile extends UrlTile {
|
|
|
367
422
|
const code = projection.getCode();
|
|
368
423
|
let tileGrid = this.tileGrids_[code];
|
|
369
424
|
if (!tileGrid) {
|
|
370
|
-
const sourceProjection = this.
|
|
371
|
-
|
|
372
|
-
sourceProjection
|
|
373
|
-
|
|
374
|
-
)
|
|
425
|
+
const sourceProjection = this.projection;
|
|
426
|
+
if (
|
|
427
|
+
sourceProjection !== null &&
|
|
428
|
+
!equivalent(sourceProjection, projection)
|
|
429
|
+
) {
|
|
430
|
+
return getForProjection(projection);
|
|
431
|
+
}
|
|
375
432
|
|
|
376
433
|
// A tile grid that matches the tile size of the source tile grid is more
|
|
377
434
|
// likely to have 1:1 relationships between source tiles and rendered tiles.
|
package/util.js
CHANGED