Respect marker set hidden by default config

This commit is contained in:
James Lyne 2020-12-14 00:35:56 +00:00
parent 9473a93633
commit 4393890661
3 changed files with 8 additions and 5 deletions

View File

@ -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,

View File

@ -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);
}
},

View File

@ -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);