diff --git a/client/src/pages/atlas/useAtlas.ts b/client/src/pages/atlas/useAtlas.ts index 6303f45f9..2d56c0457 100644 --- a/client/src/pages/atlas/useAtlas.ts +++ b/client/src/pages/atlas/useAtlas.ts @@ -374,7 +374,9 @@ export function useAtlas(options: { chromeInsets?: () => AtlasChromeInsets } = { mapInstance.current = map // The opening view centres the world beside the screen's chrome, not behind the rail and under the header. - const pan = chromePan(chromeInsetsRef.current?.(), map.latLngToContainerPoint([NORTH_EDGE_LAT, 0]).y) + // Measured only where there is chrome to clear: the desktop atlas opens exactly as before. + const insets = chromeInsetsRef.current?.() + const pan = insets ? chromePan(insets, map.latLngToContainerPoint([NORTH_EDGE_LAT, 0]).y) : null if (pan) map.panBy(pan, { animate: false }) // Both renderers live as long as the map does (see the note on the refs); map.remove() // disposes them along with every other layer it holds.