Javascript 如何在谷歌地图的标记上获得双击事件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12180102/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get double click event on the Google map's marker
提问by user1506866
In my application, I am displaying Google map having multiple markers. In that I have click event and getting info window.But what I need is, when I double click on a marker, some other page having detailed information about that marked place should be displayed.As I will be having different pages for each marker, how can I redirect to the corresponding page on double clicking the marker? Please help me.
在我的应用程序中,我正在显示具有多个标记的 Google 地图。因为我有点击事件和获取信息窗口。但是我需要的是,当我双击一个标记时,应该显示一些其他页面,其中包含有关该标记位置的详细信息。因为我将为每个标记设置不同的页面,如何通过双击标记重定向到相应的页面?请帮我。
回答by Ramesh Kotha
You can use
您可以使用
google.maps.event.addListener(marker, "dblclick", function (e) {
log("Double Click");
});
For reference : https://developers.google.com/maps/documentation/javascript/examples/marker-labels
供参考:https: //developers.google.com/maps/documentation/javascript/examples/marker-labels