api for adding overlays from extensions

This commit is contained in:
vcoppe
2025-11-11 12:11:38 +01:00
parent 683ac4e118
commit db5cbffb70
4 changed files with 194 additions and 4 deletions

View File

@@ -66,4 +66,15 @@ export function remove(node: LayerTreeType, id: string) {
return node;
}
export function removeByPrefix(node: LayerTreeType, prefix: string) {
Object.keys(node).forEach((key) => {
if (key.startsWith(prefix)) {
delete node[key];
} else if (typeof node[key] !== 'boolean') {
remove(node[key], prefix);
}
});
return node;
}
export const customBasemapUpdate = writable(0);