ol 9.0.1-dev.1710242231962 → 9.0.1-dev.1710454436434
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/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/render/canvas/ExecutorGroup.d.ts.map +1 -1
- package/render/canvas/ExecutorGroup.js +3 -2
- package/renderer/canvas/VectorLayer.d.ts +9 -3
- package/renderer/canvas/VectorLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorLayer.js +30 -24
- package/renderer/vector.d.ts.map +1 -1
- package/renderer/vector.js +3 -2
- package/util.js +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutorGroup.d.ts","sourceRoot":"","sources":["ExecutorGroup.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExecutorGroup.d.ts","sourceRoot":"","sources":["ExecutorGroup.js"],"names":[],"mappings":"AA8bA;;;;;;GAMG;AACH,2CAHW,MAAM,GACL,MAAM,MAAM,CAAC,CA2CxB;AA/dD;;;GAGG;AACH,kBAFU,MAAM,OAAO,cAAc,EAAE,WAAW,CAAC,CASjD;AAEF;;;GAGG;AACH,wBAFU,MAAM,OAAO,cAAc,EAAE,WAAW,CAAC,CAER;AAE3C;;;GAGG;AACH,4BAFU,MAAM,OAAO,cAAc,EAAE,WAAW,CAAC,CAIjD;;AAEF;IACE;;;;;;;;;;;;OAYG;IACH,uBAZW,OAAO,iBAAiB,EAAE,MAAM,cAIhC,MAAM,cACN,MAAM,YACN,OAAO;YACC,MAAM;mFA0ExB;IA5DC;;;OAGG;IACH,mBAA2B;IAE3B;;;OAGG;IACH,kBAAyB;IAEzB;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,sBAAiC;IAEjC;;;OAGG;IACH,2BAA4B;IAE5B;;;OAGG;IACH,6BAAgC;IAEhC;;;OAGG;IACH,+BAA+C;IAE/C;;;OAGG;IACH,yBAA4B;IAE5B;;OAEG;IACH;YAFiB,MAAM,GAAE,MAAM,OAAO,oBAAoB,EAAE,OAAO,CAAC;MAEnC;IAKnC;;;OAGG;IACH,cAHW,wBAAwB,aACxB,OAAO,oBAAoB,EAAE,SAAS,QAUhD;IAED;;;;;OAKG;IACH,yBAmBC;IAED;;;OAGG;IACH,wBAHW,MAAM,OAAO,cAAc,EAAE,WAAW,CAAC,GACxC,OAAO,CAYlB;IAED;;;;;;;;;OASG;IACH,0CATW,OAAO,qBAAqB,EAAE,UAAU,cACxC,MAAM,YACN,MAAM,gBACN,MAAM,mBACG,OAAO,kBAAkB,EAAE,WAAW,QAAE,OAAO,8BAA8B,EAAE,OAAO,QAAE,MAAM,6BACvG,MAAM,OAAO,kBAAkB,EAAE,WAAW,CAAC,iBA4HvD;IAED;;;OAGG;IACH,yBAHW,OAAO,oBAAoB,EAAE,SAAS,GACrC,MAAM,MAAM,CAAC,GAAC,IAAI,CAc7B;IAED;;OAEG;IACH,WAFY,OAAO,CAIlB;IAED;;;;;;;;;;OAUG;IACH,uBAVW,wBAAwB,oBACxB,OAAO,eAAe,EAAE,IAAI,aAC5B,OAAO,oBAAoB,EAAE,SAAS,gBACtC,MAAM,eACN,OAAO,mFAGP,MAAwB,IAAI,QAmEtC;IAED;;MAEC;IAED,+CAEC;IAED,uBASC;CACF"}
|
|
@@ -426,8 +426,9 @@ class ExecutorGroup {
|
|
|
426
426
|
|
|
427
427
|
renderDeferred() {
|
|
428
428
|
const deferredZIndexContexts = this.deferredZIndexContexts_;
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
const zs = Object.keys(deferredZIndexContexts).map(Number).sort(ascending);
|
|
430
|
+
for (let i = 0, ii = zs.length; i < ii; ++i) {
|
|
431
|
+
deferredZIndexContexts[zs[i]].forEach((zIndexContext) => {
|
|
431
432
|
zIndexContext.draw(this.renderedContext_); // FIXME Pass clip to replay for temporarily enabling clip
|
|
432
433
|
zIndexContext.clear();
|
|
433
434
|
});
|
|
@@ -87,7 +87,7 @@ declare class CanvasVectorLayerRenderer extends CanvasLayerRenderer<any> {
|
|
|
87
87
|
* @private
|
|
88
88
|
* @type {CanvasRenderingContext2D}
|
|
89
89
|
*/
|
|
90
|
-
private
|
|
90
|
+
private targetContext_;
|
|
91
91
|
/**
|
|
92
92
|
* @private
|
|
93
93
|
* @type {number}
|
|
@@ -100,8 +100,14 @@ declare class CanvasVectorLayerRenderer extends CanvasLayerRenderer<any> {
|
|
|
100
100
|
* `false` to only render non-declutterable items, `undefined` to render all.
|
|
101
101
|
*/
|
|
102
102
|
renderWorlds(executorGroup: ExecutorGroup, frameState: import("../../Map.js").FrameState, declutterable?: boolean | undefined): void;
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
/**
|
|
104
|
+
* @private
|
|
105
|
+
*/
|
|
106
|
+
private setDrawContext_;
|
|
107
|
+
/**
|
|
108
|
+
* @private
|
|
109
|
+
*/
|
|
110
|
+
private resetDrawContext_;
|
|
105
111
|
/**
|
|
106
112
|
* Render declutter items for this layer
|
|
107
113
|
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["VectorLayer.js"],"names":[],"mappings":";AAiDA;;;;GAIG;AACH;IACE;;OAEG;IACH,gFAwGC;IArGC,eAAe;IACf,qCAA2E;IAE3E;;OAEG;IACH,yBAFU,OAAO,CAEW;IAE5B;;OAEG;IACH,wBAFU,SAAS,GAAC,IAAI,CAEU;IAElC;;OAEG;IACH,mBAFU,MAAM,OAAO,kBAAkB,EAAE,OAAO,CAAC,CAEtB;IAE7B;;;OAGG;IACH,0BAA2B;IAE3B;;;OAGG;IACH,4BAA8B;IAE9B;;;OAGG;IACH,wBAAoC;IAEpC;;;OAGG;IACH,+BAA2C;IAE3C;;;OAGG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,wBAA2B;IAE3B;;;O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F1D;IA4FD;;;;OAIG;IACH,gCAEC;IAwMD;;;;;;;;;OASG;IACH,uBATW,OAAO,kBAAkB,EAAE,OAAO,oBAClC,MAAM,UACN,OAAO,sBAAsB,EAAE,OAAO,GAAC,MAAM,OAAO,sBAAsB,EAAE,OAAO,CAAC,gBACpF,OAAO,qCAAqC,EAAE,OAAO,mIAIpD,OAAO,CA0ClB;CACF;gCAtyB6C,YAAY;0BAKnD,sCAAsC"}
|
|
@@ -153,7 +153,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
153
153
|
* @private
|
|
154
154
|
* @type {CanvasRenderingContext2D}
|
|
155
155
|
*/
|
|
156
|
-
this.
|
|
156
|
+
this.targetContext_ = null;
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
* @private
|
|
@@ -183,7 +183,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
183
183
|
const snapToPixel = !(
|
|
184
184
|
viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING]
|
|
185
185
|
);
|
|
186
|
-
const context = this.
|
|
186
|
+
const context = this.context;
|
|
187
187
|
const width = Math.round(frameState.size[0] * pixelRatio);
|
|
188
188
|
const height = Math.round(frameState.size[1] * pixelRatio);
|
|
189
189
|
|
|
@@ -223,28 +223,33 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
223
223
|
} while (++world < endWorld);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
/**
|
|
227
|
+
* @private
|
|
228
|
+
*/
|
|
229
|
+
setDrawContext_() {
|
|
227
230
|
if (this.opacity_ !== 1) {
|
|
228
|
-
|
|
231
|
+
this.targetContext_ = this.context;
|
|
232
|
+
this.context = createCanvasContext2D(
|
|
229
233
|
this.context.canvas.width,
|
|
230
234
|
this.context.canvas.height,
|
|
231
235
|
canvasPool,
|
|
232
236
|
);
|
|
233
|
-
this.compositionContext_ = compositionContext;
|
|
234
|
-
} else {
|
|
235
|
-
this.compositionContext_ = this.context;
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
|
|
239
|
-
|
|
240
|
+
/**
|
|
241
|
+
* @private
|
|
242
|
+
*/
|
|
243
|
+
resetDrawContext_() {
|
|
240
244
|
if (this.opacity_ !== 1) {
|
|
241
|
-
const alpha = this.
|
|
242
|
-
this.
|
|
243
|
-
this.
|
|
244
|
-
this.
|
|
245
|
-
releaseCanvas(this.
|
|
246
|
-
canvasPool.push(this.
|
|
247
|
-
this.
|
|
245
|
+
const alpha = this.targetContext_.globalAlpha;
|
|
246
|
+
this.targetContext_.globalAlpha = this.opacity_;
|
|
247
|
+
this.targetContext_.drawImage(this.context.canvas, 0, 0);
|
|
248
|
+
this.targetContext_.globalAlpha = alpha;
|
|
249
|
+
releaseCanvas(this.context);
|
|
250
|
+
canvasPool.push(this.context.canvas);
|
|
251
|
+
this.context = this.targetContext_;
|
|
252
|
+
this.targetContext_ = null;
|
|
248
253
|
}
|
|
249
254
|
}
|
|
250
255
|
|
|
@@ -256,9 +261,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
256
261
|
if (!this.replayGroup_ || !this.getLayer().getDeclutter()) {
|
|
257
262
|
return;
|
|
258
263
|
}
|
|
259
|
-
this.setupCompositionContext_(); //FIXME Check if this works, or if we need to defer something.
|
|
260
264
|
this.renderWorlds(this.replayGroup_, frameState, true);
|
|
261
|
-
this.releaseCompositionContext_();
|
|
262
265
|
}
|
|
263
266
|
|
|
264
267
|
/**
|
|
@@ -270,6 +273,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
270
273
|
return;
|
|
271
274
|
}
|
|
272
275
|
this.replayGroup_.renderDeferred();
|
|
276
|
+
this.resetDrawContext_();
|
|
273
277
|
}
|
|
274
278
|
|
|
275
279
|
/**
|
|
@@ -281,6 +285,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
281
285
|
renderFrame(frameState, target) {
|
|
282
286
|
const pixelRatio = frameState.pixelRatio;
|
|
283
287
|
const layerState = frameState.layerStatesArray[frameState.layerIndex];
|
|
288
|
+
this.opacity_ = layerState.opacity;
|
|
284
289
|
|
|
285
290
|
// set forward and inverse pixel transforms
|
|
286
291
|
makeScale(this.pixelTransform, 1 / pixelRatio, 1 / pixelRatio);
|
|
@@ -289,6 +294,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
289
294
|
const canvasTransform = transformToString(this.pixelTransform);
|
|
290
295
|
|
|
291
296
|
this.useContainer(target, canvasTransform, this.getBackground(frameState));
|
|
297
|
+
|
|
292
298
|
const context = this.context;
|
|
293
299
|
const canvas = context.canvas;
|
|
294
300
|
|
|
@@ -316,14 +322,13 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
316
322
|
context.clearRect(0, 0, width, height);
|
|
317
323
|
}
|
|
318
324
|
|
|
325
|
+
this.setDrawContext_();
|
|
326
|
+
|
|
319
327
|
this.preRender(context, frameState);
|
|
320
328
|
|
|
321
329
|
const viewState = frameState.viewState;
|
|
322
330
|
const projection = viewState.projection;
|
|
323
331
|
|
|
324
|
-
this.opacity_ = layerState.opacity;
|
|
325
|
-
this.setupCompositionContext_();
|
|
326
|
-
|
|
327
332
|
// clipped rendering if layer extent is set
|
|
328
333
|
let clipped = false;
|
|
329
334
|
if (render && layerState.extent && this.clipping) {
|
|
@@ -331,7 +336,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
331
336
|
render = intersectsExtent(layerExtent, frameState.extent);
|
|
332
337
|
clipped = render && !containsExtent(layerExtent, frameState.extent);
|
|
333
338
|
if (clipped) {
|
|
334
|
-
this.clipUnrotated(
|
|
339
|
+
this.clipUnrotated(context, frameState, layerExtent);
|
|
335
340
|
}
|
|
336
341
|
}
|
|
337
342
|
|
|
@@ -344,17 +349,18 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
344
349
|
}
|
|
345
350
|
|
|
346
351
|
if (clipped) {
|
|
347
|
-
|
|
352
|
+
context.restore();
|
|
348
353
|
}
|
|
349
354
|
|
|
350
|
-
this.releaseCompositionContext_();
|
|
351
|
-
|
|
352
355
|
this.postRender(context, frameState);
|
|
353
356
|
|
|
354
357
|
if (this.renderedRotation_ !== viewState.rotation) {
|
|
355
358
|
this.renderedRotation_ = viewState.rotation;
|
|
356
359
|
this.hitDetectionImageData_ = null;
|
|
357
360
|
}
|
|
361
|
+
if (!frameState.declutter) {
|
|
362
|
+
this.resetDrawContext_();
|
|
363
|
+
}
|
|
358
364
|
return this.container;
|
|
359
365
|
}
|
|
360
366
|
|
package/renderer/vector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["vector.js"],"names":[],"mappings":"AAuCA;;;;GAIG;AACH,uCAJW,OAAO,eAAe,EAAE,WAAW,YACnC,OAAO,eAAe,EAAE,WAAW,GAClC,MAAM,CAIjB;AAED;;;;GAIG;AACH,gDAJW,MAAM,cACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;GAIG;AACH,yCAJW,MAAM,cACN,MAAM,GACL,MAAM,CAIjB;
|
|
1
|
+
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["vector.js"],"names":[],"mappings":"AAuCA;;;;GAIG;AACH,uCAJW,OAAO,eAAe,EAAE,WAAW,YACnC,OAAO,eAAe,EAAE,WAAW,GAClC,MAAM,CAIjB;AAED;;;;GAIG;AACH,gDAJW,MAAM,cACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;GAIG;AACH,yCAJW,MAAM,cACN,MAAM,GACL,MAAM,CAIjB;AAyBD;;;;;;;;;;GAUG;AACH,2CAVW,OAAO,kCAAkC,EAAE,OAAO,WAClD,OAAO,eAAe,EAAE,WAAW,SACnC,OAAO,mBAAmB,EAAE,OAAO,oBACnC,MAAM,mBACG,OAAO,oBAAoB,EAAE,OAAO,KAAG,IAAI,gIAInD,OAAO,CA+ClB;;;;;;;;wCArIqB,OAAO,eAAe,EAAE,WAAW,QAAE,OAAO,mBAAmB,EAAE,OAAO,CAAC,OAAO,kBAAkB,EAAE,OAAO,CAAC,QAAE,OAAO,2BAA2B,EAAE,OAAO,KAAG,CAAC"}
|
package/renderer/vector.js
CHANGED
|
@@ -70,14 +70,15 @@ export function getTolerance(resolution, pixelRatio) {
|
|
|
70
70
|
* @param {import("../geom/Circle.js").default} geometry Geometry.
|
|
71
71
|
* @param {import("../style/Style.js").default} style Style.
|
|
72
72
|
* @param {import("../Feature.js").default} feature Feature.
|
|
73
|
+
* @param {number} [index] Render order index.
|
|
73
74
|
*/
|
|
74
|
-
function renderCircleGeometry(builderGroup, geometry, style, feature) {
|
|
75
|
+
function renderCircleGeometry(builderGroup, geometry, style, feature, index) {
|
|
75
76
|
const fillStyle = style.getFill();
|
|
76
77
|
const strokeStyle = style.getStroke();
|
|
77
78
|
if (fillStyle || strokeStyle) {
|
|
78
79
|
const circleReplay = builderGroup.getBuilder(style.getZIndex(), 'Circle');
|
|
79
80
|
circleReplay.setFillStrokeStyle(fillStyle, strokeStyle);
|
|
80
|
-
circleReplay.drawCircle(geometry, feature);
|
|
81
|
+
circleReplay.drawCircle(geometry, feature, index);
|
|
81
82
|
}
|
|
82
83
|
const textStyle = style.getText();
|
|
83
84
|
if (textStyle && textStyle.getText()) {
|
package/util.js
CHANGED