双击多边形时禁用缩放 [英] Disabling zoom when double click on polygon

查看:67
本文介绍了双击多边形时禁用缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在地图上有一些多边形,当用户双击它们时,我不想放大。不过,我希望在地图的其他部分启用双击缩放功能。有没有什么办法可以实现这一点?

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?

非常感谢。

推荐答案

观察多边形的dblclick事件并在事件发生时调用stop()方法:

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();})

这篇关于双击多边形时禁用缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆