我仍在使用google maps v2,并且在遇到google事件时,我无法从firefox获取事件对象。最终,我需要事件对象,以便在特定叠加层的单击事件触发时检索有关按键的信息。这里是一些代码:通过javascript引用firefox事件对象
GEvent.addListener(polys[i], "click", function(e) {
var evtObj = window.event? event : e;
for (var i=0; i<polys.length; i++) {
if (this == polys[i]) {
if (evtObj.ctrlKey) {
map.closeInfoWindow();
clickCounty(labels[i]);
}
other stuff to happen....
}
});
这工作正常在IE和Chrome。传递给函数的变量'e'是'click'事件的纬度/经度。那么我将如何引用firefox事件对象而不是google事件lat/long ..?
谢谢!