fix(map): remove duplicate attribution controls — default MapLibre attribution is sufficient

This commit is contained in:
gadgethd committed 2026-08-27 23:59:16 +00:00
1 parent aee892cc82
commit 1eefb50b31
5 files changed
-12

No files matched your search

@@ -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) {
@@ -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();
@@ -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 });
@@ -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.
@@ -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;