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, {
|
||||
id: key,
|
||||
label: set.label || "Unnamed set",
|
||||
hidden: set.hidden || false,
|
||||
hidden: set.hide || false,
|
||||
priority: set.layerprio || 0,
|
||||
showLabels: set.showlabels || undefined,
|
||||
minZoom: set.minzoom || undefined,
|
||||
|
@ -48,10 +48,9 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// console.log('Mounted markerSetLayer');
|
||||
|
||||
if(!this.markerSet.hidden) {
|
||||
// console.log('Adding markerSetLayer');
|
||||
if(this.markerSet.hidden) {
|
||||
this.leaflet.getLayerManager().addHiddenLayer(this.layerGroup, this.markerSet.label, 1);
|
||||
} else {
|
||||
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) {
|
||||
this.map.removeLayer(layer);
|
||||
this.layerControl.removeLayer(layer);
|
||||
|
Loading…
Reference in New Issue
Block a user