如何从 Map 外部触发Google Map 上标记的onclick事件?
我使用API的 version 3 . 我've seen many tutorials for version 2, but can' t发现这个版本3 .
我有一个全局数组(命名标记),包含 Map 的所有标记(google.maps.Marker) . 现在我想做一些像:
markers[i].click(); //I know it's not working, but you get the idea...
//Next line seems to be the way in v2, but what's the equivalent in v3?
GEvent.trigger(markers[i], 'click');
感谢您的帮助,如果您需要更多信息,请告诉我们!
2 回答
我找到了解决方案!感谢Firebug;)
对于未来的Google员工,如果在触发多边形的点击后出现类似下面的错误
然后尝试下面的代码