fix: ensure dynamic overlays and bakedData are cleared on project switch for full data isolation
Deploy Standortplaner / deploy (push) Successful in 17s
Details
Deploy Standortplaner / deploy (push) Successful in 17s
Details
This commit is contained in:
parent
4216718992
commit
7f92172200
13
app.js
13
app.js
|
|
@ -2178,6 +2178,19 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
// 2. Clear existing owner statuses
|
// 2. Clear existing owner statuses
|
||||||
state.ownerStatuses = {};
|
state.ownerStatuses = {};
|
||||||
|
|
||||||
|
// 2.5 Clear dynamic overlays and bakedData to ensure project isolation
|
||||||
|
Object.keys(overlays).forEach(key => {
|
||||||
|
if (!['Variante A', 'Variante B', 'Variante C', 'Hilfs-Geometrien', 'Abstände (Gleiches Layout)'].includes(key)) {
|
||||||
|
if (state.map.hasLayer(overlays[key])) {
|
||||||
|
state.map.removeLayer(overlays[key]);
|
||||||
|
}
|
||||||
|
layerControl.removeLayer(overlays[key]);
|
||||||
|
delete overlays[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
state.bakedData = {};
|
||||||
|
updateLegend();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 3. Load dynamic layers for new project
|
// 3. Load dynamic layers for new project
|
||||||
await initDynamicLayers();
|
await initDynamicLayers();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue