Tag Info

Hot answers tagged


leaflet does support onmouseup event. i just used your code and modified a bit to remove eventListener on mouseup. now it's working fine even if you pan your map. circle.on({ mousedown: function () { map.on('mousemove', function (e) { circle.setLatLng(e.latlng); }); } }); map.on('mouseup',function(e){ ...


To make a circle draggable, you can add an event listener with a method for mousedown and one for click (from what I've seen, Leaflet doesn't support mouseup for Path layers). Inside the mousedown event, add a function to get the position of the circle from the current mouse position. Inside the click event, remove the previous event listener to make the ...

Only top voted, non community-wiki answers of a minimum length are eligible