Reputation: 981
I have single polyline on my map. I add dblclick event to it. It is working but also map is zooming. How to disable zooming when double click on polyline? (Or anything else with dblclick event);
Any event propagation, event stop or something?
I know and I can use map.setOptions({disableDoubleClickZoom: true });
but it is not what i really want to do.
EDIT: STUPID HACK
In polyline 'dblclick'
event just added at start : map.setZoom(map.getZoom-1);
Upvotes: 2
Views: 2573
Reputation: 12545
This is the way to do this through the api:
google.maps.event.addListener(polygonObject,'dblclick',function(e){e.stop();})
Disabling zoom when double click on polygon
Upvotes: 4
Reputation: 981
STUPID HACK
In polyline 'dblclick' event just added at start : map.setZoom(map.getZoom-1);
So first u deacrease zoom and then increase.
Upvotes: 0