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.
- package/common/utils/getLayersAsFlatArray.js +1 -1
- package/mbt.js +4 -4
- package/mbt.js.map +2 -2
- package/mbt.min.js +2 -2
- package/mbt.min.js.map +2 -2
- package/ol/layers/MapGlLayer.js +1 -1
- package/ol/layers/MaplibreStyleLayer.js +4 -4
- package/package.json +1 -1
package/ol/layers/MapGlLayer.js
CHANGED
|
@@ -103,7 +103,7 @@ class MapGlLayer extends MobilityLayerMixin(Layer) {
|
|
|
103
103
|
* A Maplibre map
|
|
104
104
|
* @type {maplibregl.Map}
|
|
105
105
|
*/
|
|
106
|
-
this.mbMap = this.createMap(Object.assign({ style: this.getStyle()
|
|
106
|
+
this.mbMap = this.createMap(Object.assign({ style: this.getStyle(), container }, (((_c = this.options) === null || _c === void 0 ? void 0 : _c.mapOptions) || {})));
|
|
107
107
|
this.mbMap.on('sourcedata', () => {
|
|
108
108
|
var _a;
|
|
109
109
|
(_a = this.getSource()) === null || _a === void 0 ? void 0 : _a.refresh(); // Refresh attribution
|
|
@@ -156,13 +156,13 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
156
156
|
maplibreMap.once('load', this.onLoad);
|
|
157
157
|
}
|
|
158
158
|
// Apply the visibiltity when layer's visibility change.
|
|
159
|
-
this.olListenersKeys.push(
|
|
159
|
+
this.olListenersKeys.push(
|
|
160
|
+
// @ts-expect-error 'load' is a custom event form mobility-toolbox-js
|
|
161
|
+
this.maplibreLayer.on('load', this.onLoad.bind(this)), this.on('change:visible', (evt) => {
|
|
160
162
|
// Once the map is loaded we can apply visiblity without waiting
|
|
161
163
|
// the style. Maplibre take care of the application of style changes.
|
|
162
164
|
this.applyLayoutVisibility(evt);
|
|
163
|
-
}),
|
|
164
|
-
// @ts-expect-error 'load' is a custom event form mobility-toolbox-js
|
|
165
|
-
this.maplibreLayer.on('load', this.onLoad), this.on('propertychange', (evt) => {
|
|
165
|
+
}), this.on('propertychange', (evt) => {
|
|
166
166
|
if (/(sources|layers|layersFilter|maplibreLayer|beforeId|)/.test(evt.key)) {
|
|
167
167
|
this.detachFromMap();
|
|
168
168
|
this.attachToMap(map);
|
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.0-beta.
|
|
5
|
+
"version": "3.0.0-beta.2",
|
|
6
6
|
"homepage": "https://mobility-toolbox-js.geops.io/",
|
|
7
7
|
"module": "index.js",
|
|
8
8
|
"exports": {
|