【发布时间】:2011-02-13 10:15:46
【问题描述】:
如何从地图外部触发 Google 地图上标记的 onclick 事件?
我使用 API 的 第 3 版。我看过很多第 2 版的教程,但找不到第 3 版的教程。
我有一个全局数组(名为 markers),其中包含地图的所有标记 (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');
感谢您的帮助,如果您需要更多信息,请告诉我!
【问题讨论】:
标签: javascript google-maps google-maps-api-3