mobility-toolbox-js 3.0.0-beta.1 → 3.0.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.
@@ -8,7 +8,7 @@ const getLayersAsFlatArray = (layersOrLayer) => {
8
8
  let flatLayers = [];
9
9
  layers.forEach((layer) => {
10
10
  flatLayers.push(layer);
11
- const { children } = layer;
11
+ const children = layer.children || layer.get('children') || {};
12
12
  flatLayers = flatLayers.concat(getLayersAsFlatArray(children || []));
13
13
  });
14
14
  return flatLayers;
package/mbt.js CHANGED
@@ -20225,7 +20225,7 @@ uniform ${i3} ${s3} u_${a3};
20225
20225
  let flatLayers = [];
20226
20226
  layers.forEach((layer) => {
20227
20227
  flatLayers.push(layer);
20228
- const { children } = layer;
20228
+ const children = layer.children || layer.get("children") || {};
20229
20229
  flatLayers = flatLayers.concat(getLayersAsFlatArray(children || []));
20230
20230
  });
20231
20231
  return flatLayers;
@@ -45730,7 +45730,7 @@ uniform ${i3} ${s3} u_${a3};
45730
45730
  container.style.width = "100%";
45731
45731
  container.style.height = "100%";
45732
45732
  this.mbMap = this.createMap({
45733
- style: this.getStyle() || { version: "8", sources: {}, layers: [] },
45733
+ style: this.getStyle(),
45734
45734
  container,
45735
45735
  ...this.options?.mapOptions || {}
45736
45736
  });
@@ -46101,11 +46101,11 @@ uniform ${i3} ${s3} u_${a3};
46101
46101
  maplibreMap.once("load", this.onLoad);
46102
46102
  }
46103
46103
  this.olListenersKeys.push(
46104
+ // @ts-expect-error 'load' is a custom event form mobility-toolbox-js
46105
+ this.maplibreLayer.on("load", this.onLoad.bind(this)),
46104
46106
  this.on("change:visible", (evt) => {
46105
46107
  this.applyLayoutVisibility(evt);
46106
46108
  }),
46107
- // @ts-expect-error 'load' is a custom event form mobility-toolbox-js
46108
- this.maplibreLayer.on("load", this.onLoad),
46109
46109
  this.on("propertychange", (evt) => {
46110
46110
  if (/(sources|layers|layersFilter|maplibreLayer|beforeId|)/.test(evt.key)) {
46111
46111
  this.detachFromMap();