本文介绍了鼠标悬停时的谷歌地图 v3 标记信息窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 stackoverflow 和其他论坛(包括 google maps v3 api 文档)中搜索了答案,但我找不到如何将触发标记信息窗口的事件从 click 更改为 mouseover 在我正在处理的文件中.

I have scoured stackoverflow and other forums including the google maps v3 api docs for an answer but I cannot find how to change the event that fires the marker info window from click to mouseover in the files I am working with.

我正在使用 google 库中的一个演示,其中包含一个融合表层.

I am working with a demo from the google library that includes a fusion table layer.

您放大集群并看到位置的红色小圆圈标记.您必须单击以显示信息窗口.我希望翻转以显示信息窗口.

You zoom into the clusters and see the small red circle markers for locations.You have to click to reveal an info window. I wish to rollover to reveal the info window.

我的演示在这里:http://www.pretravelvideo.com/gmap2/

functions.js 文件在这里完成大部分工作:http://www.pretravelvideo.com/gmap2/functions.js

The functions.js file does most of the work here:http://www.pretravelvideo.com/gmap2/functions.js

推荐答案

这是一个例子:http://duncan99.wordpress.com/2011/10/08/google-maps-api-infowindows/

marker.addListener('mouseover', function() {
    infowindow.open(map, this);
});

// assuming you also want to hide the infowindow when user mouses-out
marker.addListener('mouseout', function() {
    infowindow.close();
});

这篇关于鼠标悬停时的谷歌地图 v3 标记信息窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 21:36