Disable map zoom on CircleMarker double click

668 views
Skip to first unread message

Hemerson L. S. Carlin

unread,
Nov 19, 2012, 7:37:26 AM11/19/12
to leafl...@googlegroups.com
Hi guys! 

I'm trying to disable the zoom on the map when I click in a CircleMarker object, but until now, no success.

This is my code:

var myCircle = new L.CircleMarker(new L.LatLng(50.924480, 10.758276), 10).addTo(map);
myCircle.on("click", function () {
    //my click stuff
});
myCircle.on("dblclick", function () {
    //my dblclick stuff
});

Everytime the dblclick event is fired, the map is zoomed, how to disable it? 

Alaa Rhouma

unread,
Nov 8, 2013, 2:53:51 PM11/8/13
to leafl...@googlegroups.com

first you need to disable the map double click zoom and then enable it again on the map click event. so when you double click the map after double clicking on the marker it zoom again ;) i try it and it works for me perfectly!! enjoy!

map.doubleClickZoom.disable();

map.on('click', function (e) { 
  map.doubleClickZoom.enable();
 });



Reply all
Reply to author
Forward
0 new messages