Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(atlas): measure the opening pan only where there is chrome to clear

Mauricedfd87d413ea2
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.