简体   繁体   English

Google Maps Marker双击缩放地图

[英]Google Maps Marker double click zooming map

I have placed several makers on a Google map, as follows - 我在Google地图上放置了几个制作者,如下所示 -

var newMarker = new google.maps.Marker({ position: somePosition,
               map: map,
               title: 'My Marker',
               draggable: true
           });

and set up a number of listeners on the markers; 并在标记上设置了许多听众; click, dblclick, dragend & rightclick - click,dblclick,dragend&rightclick -

google.maps.event.addListener(newMarker, 'dblclick', function (evt) {
               doStuffWith(newMarker);
           });

This all works, my problem is that when I double click my markers, the map also zooms in. I'd like the map to zoom in when you double click the map only, if I double click a marker I'd like my listener event to fire & the map NOT to zoom. 这一切都有效,我的问题是,当我双击我的标记时,地图也会放大。我希望当你双击地图时放大地图,如果我双击一个标记我想听我的要触发的事件和地图不要缩放。

Is this possible ? 这可能吗 ? Thank you. 谢谢。

You can add 你可以加

disableDoubleClickZoom: true

to the map options. 到地图选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM