简体   繁体   English

如何打开和关闭鼠标右键单击Google Maps v3

[英]How to turn on and turn off double-right-click on Google Maps v3

When you double-right-click, the map will zoom in. 双击时,地图将放大。

How do I turn this off/on. 如何关闭/开启。 Same goes for double-left-click. 左键单击也一样。

To disable in v3, pass disableDoubleClickZoom : true in the MapOptions 要在v3中禁用,请在MapOptions中传递disableDoubleClickZoom : true

refer to: https://developers.google.com/maps/documentation/javascript/reference#MapOptions 请参阅: https : //developers.google.com/maps/documentation/javascript/reference#MapOptions

According to the API reference , there is no "right double click" event defined. 根据API参考 ,没有定义“右键单击”事件。 There is a "rightclick", a standard (left) "click", and a (left) "dblclick". 有一个“右键单击”,一个标准(左)“单击”和一个(左)“ dblclick”。 What is it you're trying to do? 您想做什么?

Appears to have been removed from v3.. here it is mentioned in v2 似乎已从v3中删除。这里在v2中提到

http://code.google.com/apis/maps/documentation/javascript/v2/reference.html http://code.google.com/apis/maps/documentation/javascript/v2/reference.html

singlerightclick(point:GPoint, src:Element, overlay?:GOverlay) singlerightclick(point:GPoint,src:Element,overlay?:GOverlay)

This event is fired when the DOM contextmenu event is fired on the map container. 在地图容器上触发DOM上下文菜单事件时,将触发此事件。 If the right click was on a marker or other clickable overlay, then the overlay is passed to the event handler in the overlay argument. 如果右键单击标记或其他可单击的叠加层,则该叠加层将通过overlay参数传递给事件处理程序。 The pixel coordinates (in the DOM element that holds the map) of the point that was right clicked and the source element of the DOM event are passed in the point and src arguments respectively. 右键单击的点的像素坐标(在保存地图的DOM元素中)和DOM事件的源元素分别在point和src参数中传递。 Note that if it is a double right click and double click to zoom is enabled, then the map zooms out and no singlerightclick event is fired. 请注意,如果是双击并启用了双击缩放功能,则地图将缩小并且不会触发singlerightclick事件。 If, however, double click to zoom is disabled, two singlerightclick events will be fired. 但是,如果禁用了双击缩放功能,则会触发两个singlerightclick事件。

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

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