Disabling zoom when double click on polygon

2020-05-06 11:14发布

问题:

I have some polygons on a map and when the user double clicks on them, I want no zoom to occur. However, I want double click zoom to be enabled on other parts of the map. Is there any way I can implement this?

Thanks a lot.

回答1:

Observe the dblclick-event of the polygon(s) and call the stop()-method of the event when it occurs:

google.maps.event.addListener(polygonObject,'dblclick',function(e){e.stop();})