mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-10-16 04:18:19 +00:00
remove layer from map when removed from layer selection, maybe related to #110
This commit is contained in:
@@ -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);
|
Reference in New Issue
Block a user