fix(geoportal): force all layers hidden on map load (fixes terenuri/cladiri showing when toggled off)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -452,7 +452,9 @@ export const MapViewer = forwardRef<MapViewerHandle, MapViewerProps>(
|
||||
paint: { "line-color": "#f59e0b", "line-width": 2, "line-dasharray": [3, 2] },
|
||||
});
|
||||
|
||||
if (layerVisibility) applyLayerVisibility(layerVisibility);
|
||||
// Apply initial visibility — HIDE ALL by default, then show only enabled ones
|
||||
const allOff: Record<string, boolean> = { uats: false, terenuri: false, cladiri: false, administrativ: false };
|
||||
applyLayerVisibility(layerVisibility ? { ...allOff, ...layerVisibility } : allOff);
|
||||
setMapReady(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user