mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
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
This commit is contained in:
@@ -168,7 +168,8 @@ const JourneyMap = forwardRef<JourneyMapHandle, Props>(function JourneyMap(
|
|||||||
L.tileLayer(mapTileUrl || defaultTile, {
|
L.tileLayer(mapTileUrl || defaultTile, {
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
||||||
}).addTo(map)
|
referrerPolicy: 'strict-origin-when-cross-origin',
|
||||||
|
} as any).addTo(map)
|
||||||
|
|
||||||
const items = buildMarkerItems(entries)
|
const items = buildMarkerItems(entries)
|
||||||
itemsRef.current = items
|
itemsRef.current = items
|
||||||
|
|||||||
@@ -296,8 +296,9 @@ export default function AtlasPage(): React.ReactElement {
|
|||||||
updateWhenIdle: false,
|
updateWhenIdle: false,
|
||||||
tileSize: 256,
|
tileSize: 256,
|
||||||
zoomOffset: 0,
|
zoomOffset: 0,
|
||||||
crossOrigin: true
|
crossOrigin: true,
|
||||||
}).addTo(map)
|
referrerPolicy: 'strict-origin-when-cross-origin',
|
||||||
|
} as any).addTo(map)
|
||||||
|
|
||||||
// Preload adjacent zoom level tiles
|
// Preload adjacent zoom level tiles
|
||||||
L.tileLayer(tileUrl, {
|
L.tileLayer(tileUrl, {
|
||||||
@@ -306,6 +307,7 @@ export default function AtlasPage(): React.ReactElement {
|
|||||||
opacity: 0,
|
opacity: 0,
|
||||||
tileSize: 256,
|
tileSize: 256,
|
||||||
crossOrigin: true,
|
crossOrigin: true,
|
||||||
|
referrerPolicy: 'strict-origin-when-cross-origin',
|
||||||
}).addTo(map)
|
}).addTo(map)
|
||||||
|
|
||||||
// Custom pane for region layer — above overlay (z-index 400)
|
// Custom pane for region layer — above overlay (z-index 400)
|
||||||
|
|||||||
Reference in New Issue
Block a user