From 00e96baf0e66f925e2762d2d675eb35b795f01cf Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 14 Apr 2026 20:21:57 +0200 Subject: [PATCH] Fix Stadia Maps 401 on journey and atlas maps (#640) - Add referrerPolicy to JourneyMap TileLayer (matching trip planner behavior) - Add referrerPolicy to AtlasPage TileLayer (same issue) - Stadia Maps requires the referrer header for domain validation --- client/src/components/Journey/JourneyMap.tsx | 3 ++- client/src/pages/AtlasPage.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/components/Journey/JourneyMap.tsx b/client/src/components/Journey/JourneyMap.tsx index 082c4a4f..88b08d0b 100644 --- a/client/src/components/Journey/JourneyMap.tsx +++ b/client/src/components/Journey/JourneyMap.tsx @@ -168,7 +168,8 @@ const JourneyMap = forwardRef(function JourneyMap( L.tileLayer(mapTileUrl || defaultTile, { maxZoom: 18, attribution: '© OpenStreetMap', - }).addTo(map) + referrerPolicy: 'strict-origin-when-cross-origin', + } as any).addTo(map) const items = buildMarkerItems(entries) itemsRef.current = items diff --git a/client/src/pages/AtlasPage.tsx b/client/src/pages/AtlasPage.tsx index 0195da71..4dc4047e 100644 --- a/client/src/pages/AtlasPage.tsx +++ b/client/src/pages/AtlasPage.tsx @@ -296,8 +296,9 @@ export default function AtlasPage(): React.ReactElement { updateWhenIdle: false, tileSize: 256, zoomOffset: 0, - crossOrigin: true - }).addTo(map) + crossOrigin: true, + referrerPolicy: 'strict-origin-when-cross-origin', + } as any).addTo(map) // Preload adjacent zoom level tiles L.tileLayer(tileUrl, { @@ -306,6 +307,7 @@ export default function AtlasPage(): React.ReactElement { opacity: 0, tileSize: 256, crossOrigin: true, + referrerPolicy: 'strict-origin-when-cross-origin', }).addTo(map) // Custom pane for region layer — above overlay (z-index 400)