Leaflet and how avoid map panning on mouseout
12 May, 2014
- 3 min read
A couple of days ago
, a friend asked this simple question in a Spanish forum. The scenario is simple, you have a map and when dragging it you would like to stop the action when the mouse goes beyond the limits of the map, really beyond the (or any other DOM element that) contains the map. The first try anyone can try could be something like: {% highlight javascript %}
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView([51.505, -0.09], 1…