Can I prevent panning Leaflet map out of the world’s edge?
Leaflet allows you to control how much the map resists being dragged out of bounds with the maxBoundsViscosity option (value: 0 to 1). Setting it to maximum disables dragging out of bounds entirely. var map = new L.Map(‘map’, { center: bounds.getCenter(), zoom: 5, layers: [osm], maxBounds: bounds, maxBoundsViscosity: 1.0 }); This feature is available in … Read more