Respect marker set hidden by default config
This commit is contained in:
parent
9473a93633
commit
4393890661
@ -490,7 +490,7 @@ export default {
|
|||||||
sets.set(key, {
|
sets.set(key, {
|
||||||
id: key,
|
id: key,
|
||||||
label: set.label || "Unnamed set",
|
label: set.label || "Unnamed set",
|
||||||
hidden: set.hidden || false,
|
hidden: set.hide || false,
|
||||||
priority: set.layerprio || 0,
|
priority: set.layerprio || 0,
|
||||||
showLabels: set.showlabels || undefined,
|
showLabels: set.showlabels || undefined,
|
||||||
minZoom: set.minzoom || undefined,
|
minZoom: set.minzoom || undefined,
|
||||||
|
@ -48,10 +48,9 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
// console.log('Mounted markerSetLayer');
|
if(this.markerSet.hidden) {
|
||||||
|
this.leaflet.getLayerManager().addHiddenLayer(this.layerGroup, this.markerSet.label, 1);
|
||||||
if(!this.markerSet.hidden) {
|
} else {
|
||||||
// console.log('Adding markerSetLayer');
|
|
||||||
this.leaflet.getLayerManager().addLayer(this.layerGroup, true, this.markerSet.label, 1);
|
this.leaflet.getLayerManager().addLayer(this.layerGroup, true, this.markerSet.label, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -26,6 +26,10 @@ export default class LayerManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addHiddenLayer(layer: Layer, name: string, position: number) {
|
||||||
|
this.layerControl.addOverlay(layer, name);
|
||||||
|
}
|
||||||
|
|
||||||
removeLayer(layer: Layer) {
|
removeLayer(layer: Layer) {
|
||||||
this.map.removeLayer(layer);
|
this.map.removeLayer(layer);
|
||||||
this.layerControl.removeLayer(layer);
|
this.layerControl.removeLayer(layer);
|
||||||
|
Loading…
Reference in New Issue
Block a user