Use L.CRS.Simple in leaflet, that maps coordinates to pixels
This commit is contained in:
parent
dc7098daf3
commit
0da6845bde
|
@ -28,13 +28,15 @@
|
|||
const latLngBounds = L.latLngBounds([[0, 0], [1192, 1500]]);
|
||||
const map = L.map(container, {
|
||||
center: latLngBounds.getCenter(),
|
||||
zoom: 4,
|
||||
minZoom: -2,
|
||||
maxZoom: 3,
|
||||
zoom: -1,
|
||||
scrollWheelZoom: false,
|
||||
maxBounds: latLngBounds,
|
||||
maxBoundsViscosity: 1.0,
|
||||
zoomSnap: 0,
|
||||
crs: L.CRS.Simple,
|
||||
});
|
||||
map.setMinZoom(map.getBoundsZoom(latLngBounds, true));
|
||||
map.fitBounds(latLngBounds);
|
||||
L.svgOverlay(svg, latLngBounds).addTo(map);
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue