From 1eefb50b31fda8d79ef383a658764671c65cb46a Mon Sep 17 00:00:00 2001 From: gadgethd <111318106+gadgethd@users.noreply.github.com> Date: Thu, 27 Aug 2026 23:36:48 +0000 Subject: [PATCH] =?UTF-8?q?fix(map):=20remove=20duplicate=20attribution=20?= =?UTF-8?q?controls=20=E2=80=94=20default=20MapLibre=20attribution=20is=20?= =?UTF-8?q?sufficient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Map/MapLibreMap.tsx | 7 ------- frontend/src/components/stats/StatsPrimitives.tsx | 1 - frontend/src/pages/SpamTransparencyPage.tsx | 2 -- frontend/src/pages/owner/OwnerMapView.tsx | 1 - frontend/src/pages/ukmesh/PacketPathMap.tsx | 1 - 5 files changed, 12 deletions(-) diff --git a/frontend/src/components/Map/MapLibreMap.tsx b/frontend/src/components/Map/MapLibreMap.tsx index 41d1e5d..81309ff 100644 --- a/frontend/src/components/Map/MapLibreMap.tsx +++ b/frontend/src/components/Map/MapLibreMap.tsx @@ -736,13 +736,6 @@ export function MapLibreMap({ }); mapRef.current = map; - // MapLibre adds this control by default when attributionControl is not - // disabled. Keep an explicit compact fallback for alternate MapLibre - // builds without creating a duplicate control in the standard build. - if (!map.getContainer().querySelector('.maplibregl-ctrl-attrib')) { - map.addControl(new maplibregl.AttributionControl({ compact: true })); - } - const handleStyleLoad = () => { const targetStyle = mapLightRef.current ? OPENFREEMAP_STYLE_LIGHT : OPENFREEMAP_STYLE_DARK; if (styleUrlRef.current !== targetStyle) { diff --git a/frontend/src/components/stats/StatsPrimitives.tsx b/frontend/src/components/stats/StatsPrimitives.tsx index fb149c2..424b448 100644 --- a/frontend/src/components/stats/StatsPrimitives.tsx +++ b/frontend/src/components/stats/StatsPrimitives.tsx @@ -282,7 +282,6 @@ export const DecodedPathMapView: React.FC<{ nodes: DecodedPathNode[] }> = ({ nod center: [Number(nodes[0]!.lon), Number(nodes[0]!.lat)], zoom: 8, }); - map.addControl(new maplibre.AttributionControl({ compact: true })); map.on('load', () => { if (cancelled || !map) return; const bounds = new maplibre.LngLatBounds(); diff --git a/frontend/src/pages/SpamTransparencyPage.tsx b/frontend/src/pages/SpamTransparencyPage.tsx index 61f235e..e7bdd66 100644 --- a/frontend/src/pages/SpamTransparencyPage.tsx +++ b/frontend/src/pages/SpamTransparencyPage.tsx @@ -178,7 +178,6 @@ const OriginMiniMap = memo(function OriginMiniMap({ bounds, fitBoundsOptions: { padding: 40, maxZoom: 10 }, }); - map.addControl(new maplibregl.AttributionControl({ compact: true })); map.addControl(new maplibregl.NavigationControl({ showCompass: false }), 'top-right'); map.on('load', () => { map.addSource('zone', { @@ -489,7 +488,6 @@ export function SpamPage() { center: [-2.5, 54.0], zoom: 4.6, }); - map.addControl(new maplibregl.AttributionControl({ compact: true })); map.addControl(new maplibregl.NavigationControl({ showCompass: false }), 'top-right'); map.on('load', () => { map.addSource('zones', { type: 'geojson', data: EMPTY_FC }); diff --git a/frontend/src/pages/owner/OwnerMapView.tsx b/frontend/src/pages/owner/OwnerMapView.tsx index 0a3ba5e..8b24dce 100644 --- a/frontend/src/pages/owner/OwnerMapView.tsx +++ b/frontend/src/pages/owner/OwnerMapView.tsx @@ -112,7 +112,6 @@ export const OwnerMapView: React.FC<{ center: [DEFAULT_CENTER[1], DEFAULT_CENTER[0]], zoom: 7, }); - map.addControl(new maplibregl.AttributionControl({ compact: true })); mapRef.current = map; // Keep the map as a static regional backdrop while preserving marker clicks. diff --git a/frontend/src/pages/ukmesh/PacketPathMap.tsx b/frontend/src/pages/ukmesh/PacketPathMap.tsx index c2a84af..98de0f6 100644 --- a/frontend/src/pages/ukmesh/PacketPathMap.tsx +++ b/frontend/src/pages/ukmesh/PacketPathMap.tsx @@ -193,7 +193,6 @@ export const PathMap: React.FC<{ pitch: 50, bearing: -8, }); - nextMap.addControl(new maplibre.AttributionControl({ compact: true })); mapRef.current = nextMap; nextMap.on('load', () => { if (cancelled || !nextMap) return;