fix(maps): zooming stays centred on the grid and decode maps

The hard maxBounds added for the single-world look fought the zoom: with
the world smaller than the window the clamp dragged every zoom step into
a corner. The noWrap tiles already guarantee one world on their own, so
the bounds go — on both maps.
This commit is contained in:
2026-08-30 22:18:27 +02:00
parent d7ee87f22d
commit f2ba798764
2 changed files with 3 additions and 7 deletions
+2 -2
View File
@@ -55,10 +55,10 @@ export function FTMapPanel({ decodes, myGrid }: { decodes: FTMapDecode[]; myGrid
// and the space beyond the edge is the theme's own surface (style.css).
const m = L.map(divRef.current, {
zoomControl: true, attributionControl: true,
// No maxBounds: with the world smaller than the window the clamp
// dragged every zoom into a corner. noWrap tiles alone keep one world.
worldCopyJump: false, preferCanvas: true,
center: [25, 0], zoom: 2, minZoom: 2,
maxBounds: L.latLngBounds(L.latLng(-85.0511, -180), L.latLng(85.0511, 180)),
maxBoundsViscosity: 1,
});
mapRef.current = m;
layerRef.current = L.layerGroup().addTo(m);