mobility-toolbox-js 3.0.0-beta.26 → 3.0.0-beta.28
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/mbt.js +22 -2
- package/mbt.js.map +3 -3
- package/mbt.min.js +13 -13
- package/mbt.min.js.map +3 -3
- package/ol/layers/Layer.js +10 -2
- package/ol/layers/MaplibreLayer.js +5 -0
- package/ol/layers/MaplibreStyleLayer.js +10 -0
- package/package.json +1 -1
package/mbt.js
CHANGED
|
@@ -52437,7 +52437,9 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
52437
52437
|
...options.mapLibreOptions || {}
|
|
52438
52438
|
}
|
|
52439
52439
|
};
|
|
52440
|
-
if (!newOptions.mapLibreOptions.style && newOptions.
|
|
52440
|
+
if (!newOptions.mapLibreOptions.style && newOptions.url?.includes("style.json")) {
|
|
52441
|
+
newOptions.mapLibreOptions.style = newOptions.url;
|
|
52442
|
+
} else if (!newOptions.mapLibreOptions.style && newOptions.apiKey && newOptions.style && typeof newOptions.style === "string") {
|
|
52441
52443
|
newOptions.mapLibreOptions.style = buildStyleUrl(
|
|
52442
52444
|
newOptions.url,
|
|
52443
52445
|
newOptions.style,
|
|
@@ -52771,6 +52773,16 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
52771
52773
|
this.detachFromMap();
|
|
52772
52774
|
this.attachToMap(map);
|
|
52773
52775
|
}
|
|
52776
|
+
}),
|
|
52777
|
+
// When the style changes we wait that it is loaded to relaunch the onLoad
|
|
52778
|
+
this.maplibreLayer.on("propertychange", (evt) => {
|
|
52779
|
+
if (evt.key === "style") {
|
|
52780
|
+
evt.target.maplibreMap.once("styledata", () => {
|
|
52781
|
+
evt.target.maplibreMap.once("idle", () => {
|
|
52782
|
+
this.onLoad();
|
|
52783
|
+
});
|
|
52784
|
+
});
|
|
52785
|
+
}
|
|
52774
52786
|
})
|
|
52775
52787
|
);
|
|
52776
52788
|
}
|
|
@@ -54381,6 +54393,14 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
54381
54393
|
console.warn(message);
|
|
54382
54394
|
}, 1e3);
|
|
54383
54395
|
}
|
|
54396
|
+
var EmptyLayerRenderer = class extends Layer_default2 {
|
|
54397
|
+
prepareFrame() {
|
|
54398
|
+
return true;
|
|
54399
|
+
}
|
|
54400
|
+
renderFrame() {
|
|
54401
|
+
return null;
|
|
54402
|
+
}
|
|
54403
|
+
};
|
|
54384
54404
|
var Layer2 = class _Layer extends MobilityLayerMixin_default(Layer_default) {
|
|
54385
54405
|
constructor(options) {
|
|
54386
54406
|
super(options);
|
|
@@ -54394,7 +54414,7 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
54394
54414
|
}
|
|
54395
54415
|
// ol does not like when it returns null.
|
|
54396
54416
|
createRenderer() {
|
|
54397
|
-
return new
|
|
54417
|
+
return new EmptyLayerRenderer(this);
|
|
54398
54418
|
}
|
|
54399
54419
|
};
|
|
54400
54420
|
var Layer_default4 = Layer2;
|