mobility-toolbox-js 3.1.0-beta.0 → 3.1.0-beta.2
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.
|
@@ -13,20 +13,20 @@ export default class MaplibreLayerRenderer extends MapLibreLayerRenderer {
|
|
|
13
13
|
this.ignoreNextRender = false;
|
|
14
14
|
}
|
|
15
15
|
renderFrame(frameState) {
|
|
16
|
-
var _a, _b;
|
|
17
16
|
const layer = this.getLayer();
|
|
18
17
|
const { mapLibreMap } = layer;
|
|
19
18
|
const map = layer.getMapInternal();
|
|
20
|
-
(_b = (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.mapLibreMap) === null || _b === void 0 ? void 0 : _b.off('idle', this.setIsReady);
|
|
21
19
|
if (!layer || !map || !mapLibreMap) {
|
|
22
20
|
// @ts-expect-error - can return null
|
|
23
21
|
return null;
|
|
24
22
|
}
|
|
25
|
-
if (this.ignoreNextRender) {
|
|
23
|
+
if (this.ready && this.ignoreNextRender) {
|
|
26
24
|
this.ignoreNextRender = false;
|
|
27
25
|
return mapLibreMap === null || mapLibreMap === void 0 ? void 0 : mapLibreMap.getContainer();
|
|
28
26
|
}
|
|
29
27
|
this.ready = false;
|
|
28
|
+
this.ignoreNextRender = false;
|
|
29
|
+
this.updateReadyState();
|
|
30
30
|
const container = super.renderFrame(frameState);
|
|
31
31
|
// Mark the renderer as ready when the map is idle
|
|
32
32
|
mapLibreMap === null || mapLibreMap === void 0 ? void 0 : mapLibreMap.once('idle', this.setIsReady);
|
|
@@ -39,4 +39,9 @@ export default class MaplibreLayerRenderer extends MapLibreLayerRenderer {
|
|
|
39
39
|
this.getLayer().changed();
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
updateReadyState() {
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
|
+
(_b = (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.mapLibreMap) === null || _b === void 0 ? void 0 : _b.off('idle', this.setIsReady);
|
|
45
|
+
(_d = (_c = this.getLayer()) === null || _c === void 0 ? void 0 : _c.mapLibreMap) === null || _d === void 0 ? void 0 : _d.once('idle', this.setIsReady);
|
|
46
|
+
}
|
|
42
47
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "mobility-toolbox-js",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
|
|
5
|
-
"version": "3.1.0-beta.
|
|
5
|
+
"version": "3.1.0-beta.2",
|
|
6
6
|
"homepage": "https://mobility-toolbox-js.geops.io/",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./index.js",
|