From 0da6845bde5a33bae33e532e48891197093ff61a Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Thu, 25 Jan 2024 02:16:16 +0100 Subject: [PATCH] Use L.CRS.Simple in leaflet, that maps coordinates to pixels --- web/templates/public/campground.gohtml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/templates/public/campground.gohtml b/web/templates/public/campground.gohtml index bfa8a1e..3e1ff61 100644 --- a/web/templates/public/campground.gohtml +++ b/web/templates/public/campground.gohtml @@ -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); })();