mobility-toolbox-js 3.0.0-beta.18 → 3.0.0-beta.19
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 +7 -7
- package/mbt.js.map +2 -2
- package/mbt.min.js +1 -1
- package/mbt.min.js.map +3 -3
- package/ol/layers/MaplibreLayer.js +3 -1
- package/ol/renderers/MaplibreStyleLayerRenderer.js +6 -6
- package/package.json +1 -1
package/mbt.js
CHANGED
|
@@ -52281,7 +52281,7 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
52281
52281
|
...options.mapLibreOptions || {}
|
|
52282
52282
|
}
|
|
52283
52283
|
};
|
|
52284
|
-
if (!newOptions.mapLibreOptions.style && newOptions.apiKey) {
|
|
52284
|
+
if (!newOptions.mapLibreOptions.style && newOptions.apiKey && newOptions.style) {
|
|
52285
52285
|
newOptions.mapLibreOptions.style = buildStyleUrl(
|
|
52286
52286
|
newOptions.url,
|
|
52287
52287
|
newOptions.style,
|
|
@@ -52354,7 +52354,7 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
52354
52354
|
}
|
|
52355
52355
|
const layer = this.getLayer();
|
|
52356
52356
|
const map = layer.getMapInternal();
|
|
52357
|
-
const {
|
|
52357
|
+
const { mapLibreMap } = layer.maplibreLayer;
|
|
52358
52358
|
const projection = map?.getView()?.getProjection()?.getCode() || "EPSG:3857";
|
|
52359
52359
|
let features = [];
|
|
52360
52360
|
if (!formats2[projection]) {
|
|
@@ -52362,8 +52362,8 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
52362
52362
|
featureProjection: projection
|
|
52363
52363
|
});
|
|
52364
52364
|
}
|
|
52365
|
-
if (
|
|
52366
|
-
const pixel = coordinate &&
|
|
52365
|
+
if (mapLibreMap?.isStyleLoaded()) {
|
|
52366
|
+
const pixel = coordinate && mapLibreMap.project(toLonLat(coordinate));
|
|
52367
52367
|
if (pixel?.x && pixel?.y) {
|
|
52368
52368
|
let pixels = [
|
|
52369
52369
|
pixel.x,
|
|
@@ -52378,12 +52378,12 @@ uniform ${i3} ${a3} u_${s3};
|
|
|
52378
52378
|
}
|
|
52379
52379
|
let layers = layer.layers || [];
|
|
52380
52380
|
if (layer.layersFilter) {
|
|
52381
|
-
layers =
|
|
52381
|
+
layers = mapLibreMap.getStyle().layers.filter(layer.layersFilter);
|
|
52382
52382
|
}
|
|
52383
52383
|
if (layer.queryRenderedLayersFilter) {
|
|
52384
|
-
layers =
|
|
52384
|
+
layers = mapLibreMap.getStyle().layers.filter(layer.queryRenderedLayersFilter);
|
|
52385
52385
|
}
|
|
52386
|
-
features =
|
|
52386
|
+
features = mapLibreMap.queryRenderedFeatures(pixels, {
|
|
52387
52387
|
layers: layers.map((l) => l.id),
|
|
52388
52388
|
validate: false
|
|
52389
52389
|
// ...layer.queryRenderedFeaturesOptions,
|