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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user