Fix: probably fix black area outlines

This commit is contained in:
Pieter Vander Vennet 2023-10-06 02:23:24 +02:00
parent 6e5fcdef20
commit 0bd9e1e667
3 changed files with 9 additions and 8 deletions

View file

@ -417,6 +417,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
if (!map.getLayer(addLayerBeforeId)) { if (!map.getLayer(addLayerBeforeId)) {
addLayerBeforeId = undefined addLayerBeforeId = undefined
} }
await this.awaitStyleIsLoaded()
if (!map.getSource(background.id)) { if (!map.getSource(background.id)) {
map.addSource(background.id, MapLibreAdaptor.prepareWmsSource(background)) map.addSource(background.id, MapLibreAdaptor.prepareWmsSource(background))
} }

View file

@ -230,8 +230,6 @@ class LineRenderingLayer {
features.features.addCallbackAndRunD(() => self.update(features.features)) features.features.addCallbackAndRunD(() => self.update(features.features))
map.on("styledata", () => self.update(features.features)) map.on("styledata", () => self.update(features.features))
// map.on("style.load", () => self.update(features.features))
} }
public destruct(): void { public destruct(): void {
@ -353,7 +351,6 @@ class LineRenderingLayer {
return; return;
} }
e.originalEvent["consumed"] = true; e.originalEvent["consumed"] = true;
console.log("Got features:", e.features, e);
this._onClick(e.features[0]); this._onClick(e.features[0]);
}); });
} }
@ -397,9 +394,6 @@ class LineRenderingLayer {
if (this._listenerInstalledOn.has(id)) { if (this._listenerInstalledOn.has(id)) {
continue continue
} }
if (!map.getSource(this._layername)) {
continue
}
if (this._fetchStore === undefined) { if (this._fetchStore === undefined) {
map.setFeatureState( map.setFeatureState(
{ source: this._layername, id }, { source: this._layername, id },
@ -408,7 +402,11 @@ class LineRenderingLayer {
} else { } else {
const tags = this._fetchStore(id) const tags = this._fetchStore(id)
this._listenerInstalledOn.add(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)){ if(!map.getLayer(this._layername)){
return return
} }

View file

@ -80,7 +80,9 @@ export class MinimapViz implements SpecialVisualization {
) )
const mlmap = new UIEventSource(undefined) const mlmap = new UIEventSource(undefined)
const mla = new MapLibreAdaptor(mlmap) const mla = new MapLibreAdaptor(mlmap, {
rasterLayer: state.mapProperties.rasterLayer
})
mla.maxzoom.setData(17) mla.maxzoom.setData(17)
let zoom = 18 let zoom = 18