diff --git a/src/UI/Map/MapLibreAdaptor.ts b/src/UI/Map/MapLibreAdaptor.ts index f1508a923..a19c5164e 100644 --- a/src/UI/Map/MapLibreAdaptor.ts +++ b/src/UI/Map/MapLibreAdaptor.ts @@ -417,6 +417,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { if (!map.getLayer(addLayerBeforeId)) { addLayerBeforeId = undefined } + await this.awaitStyleIsLoaded() if (!map.getSource(background.id)) { map.addSource(background.id, MapLibreAdaptor.prepareWmsSource(background)) } diff --git a/src/UI/Map/ShowDataLayer.ts b/src/UI/Map/ShowDataLayer.ts index 107e41375..fc5a34f7f 100644 --- a/src/UI/Map/ShowDataLayer.ts +++ b/src/UI/Map/ShowDataLayer.ts @@ -230,8 +230,6 @@ class LineRenderingLayer { features.features.addCallbackAndRunD(() => self.update(features.features)) map.on("styledata", () => self.update(features.features)) - // map.on("style.load", () => self.update(features.features)) - } public destruct(): void { @@ -353,7 +351,6 @@ class LineRenderingLayer { return; } e.originalEvent["consumed"] = true; - console.log("Got features:", e.features, e); this._onClick(e.features[0]); }); } @@ -397,9 +394,6 @@ class LineRenderingLayer { if (this._listenerInstalledOn.has(id)) { continue } - if (!map.getSource(this._layername)) { - continue - } if (this._fetchStore === undefined) { map.setFeatureState( { source: this._layername, id }, @@ -408,7 +402,11 @@ class LineRenderingLayer { } else { const tags = this._fetchStore(id) this._listenerInstalledOn.add(id) - tags.addCallbackAndRunD((properties) => { + map.setFeatureState( + { source: this._layername, id }, + this.calculatePropsFor(feature.properties) + ) + tags.addCallbackD((properties) => { if(!map.getLayer(this._layername)){ return } diff --git a/src/UI/Popup/MinimapViz.ts b/src/UI/Popup/MinimapViz.ts index 873770b4e..d320ab632 100644 --- a/src/UI/Popup/MinimapViz.ts +++ b/src/UI/Popup/MinimapViz.ts @@ -80,7 +80,9 @@ export class MinimapViz implements SpecialVisualization { ) const mlmap = new UIEventSource(undefined) - const mla = new MapLibreAdaptor(mlmap) + const mla = new MapLibreAdaptor(mlmap, { + rasterLayer: state.mapProperties.rasterLayer + }) mla.maxzoom.setData(17) let zoom = 18