remove layer from map when removed from layer selection, maybe related to #110

This commit is contained in:
vcoppe
2024-09-24 14:40:08 +02:00
parent 9eb716e36c
commit 369c2a5fb6
3 changed files with 44 additions and 13 deletions

View File

@@ -39,4 +39,15 @@ export function isSelected(node: LayerTreeType, id: string) {
});
}
export function toggle(node: LayerTreeType, id: string) {
Object.keys(node).forEach((key) => {
if (key === id) {
node[key] = !node[key];
} else if (typeof node[key] !== "boolean") {
toggle(node[key], id);
}
});
return node;
}
export const customBasemapUpdate = writable(0);