mobility-toolbox-js 3.0.1-beta.2 → 3.0.1-beta.3

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,16 +13,18 @@ export default class MaplibreLayerRenderer extends MapLibreLayerRenderer {
13
13
  this.ignoreNextRender = false;
14
14
  }
15
15
  renderFrame(frameState) {
16
- var _a, _b, _c;
16
+ var _a, _b;
17
+ const layer = this.getLayer();
18
+ const { mapLibreMap } = layer;
19
+ const map = layer.getMapInternal();
17
20
  (_b = (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.mapLibreMap) === null || _b === void 0 ? void 0 : _b.off('idle', this.setIsReady);
18
- const mapLibreMap = (_c = this.getLayer()) === null || _c === void 0 ? void 0 : _c.mapLibreMap;
19
- mapLibreMap === null || mapLibreMap === void 0 ? void 0 : mapLibreMap.off('idle', this.setIsReady);
21
+ if (!layer || !map || !mapLibreMap) {
22
+ // @ts-expect-error - can return null
23
+ return null;
24
+ }
20
25
  if (this.ignoreNextRender) {
21
26
  this.ignoreNextRender = false;
22
- const container = mapLibreMap === null || mapLibreMap === void 0 ? void 0 : mapLibreMap.getContainer();
23
- if (container) {
24
- return container;
25
- }
27
+ return mapLibreMap === null || mapLibreMap === void 0 ? void 0 : mapLibreMap.getContainer();
26
28
  }
27
29
  this.ready = false;
28
30
  const container = super.renderFrame(frameState);
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.0.1-beta.2",
5
+ "version": "3.0.1-beta.3",
6
6
  "homepage": "https://mobility-toolbox-js.geops.io/",
7
7
  "exports": {
8
8
  ".": "./index.js",