diff --git a/frontend/src/components/FTMapPanel.tsx b/frontend/src/components/FTMapPanel.tsx index 908f074..1d25dce 100644 --- a/frontend/src/components/FTMapPanel.tsx +++ b/frontend/src/components/FTMapPanel.tsx @@ -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); diff --git a/frontend/src/components/GridSquareMap.tsx b/frontend/src/components/GridSquareMap.tsx index ab71c8c..ffd6e0e 100644 --- a/frontend/src/components/GridSquareMap.tsx +++ b/frontend/src/components/GridSquareMap.tsx @@ -128,15 +128,11 @@ export function GridSquareMap({ myGrid, className }: { myGrid?: string; classNam // impossible on any window wider than it is tall: one step out was already // too far in. minZoom: 0, - maxBoundsViscosity: 1, // don't let a drag slide the world off to one side + }).setView([20, 0], 2); // The whole world, once, whatever the window is shaped like — computed by // Leaflet from the container rather than guessed with a zoom number. m.fitWorld({ animate: false }); - // Latitude only: the poles are the edge of the projection and there is - // nothing beyond them, while leaving longitude free keeps a drag from - // fighting the operator near the date line. - m.setMaxBounds(L.latLngBounds(L.latLng(-85, -Infinity), L.latLng(85, Infinity))); mapRef.current = m; layerRef.current = L.layerGroup().addTo(m); // Leaflet measures its container ONCE, when the map is created, and never