From 7ae23aebf4c91b0ab0c2f194281a712666a36931 Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Tue, 24 Mar 2026 13:18:44 +0200 Subject: [PATCH] fix(geoportal): hide OpenFreeMap built-in boundary layers on load OpenFreeMap Liberty/Dark styles include admin boundary layers that show even when our UAT toggle is off. Now hides all boundary/admin/border layers from the basemap style on map load. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/modules/geoportal/components/map-viewer.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/geoportal/components/map-viewer.tsx b/src/modules/geoportal/components/map-viewer.tsx index 42a5bcc..c13361d 100644 --- a/src/modules/geoportal/components/map-viewer.tsx +++ b/src/modules/geoportal/components/map-viewer.tsx @@ -362,6 +362,14 @@ export const MapViewer = forwardRef( map.on("load", () => { const m = resolvedMartinUrl; + // Hide OpenFreeMap's built-in boundary/admin layers (we have our own) + for (const layer of map.getStyle().layers) { + const id = layer.id.toLowerCase(); + if (id.includes("boundar") || id.includes("admin") || (id.includes("border") && !id.includes("water"))) { + try { map.setLayoutProperty(layer.id, "visibility", "none"); } catch { /* noop */ } + } + } + // === UAT z0-5: very coarse — lines only === map.addSource(SOURCES.uatsZ0, { type: "vector", tiles: [`${m}/${SOURCES.uatsZ0}/{z}/{x}/{y}`], minzoom: 0, maxzoom: 5 }); map.addLayer({ id: LAYER_IDS.uatsZ0Line, type: "line", source: SOURCES.uatsZ0, "source-layer": SOURCES.uatsZ0, maxzoom: 5,