0

这是我的代码:

google.maps.event.addListener(marker, 'rightclick', function(event) {

    //delete marker
    var nowIndex1='nowIndex1';
    function callback1(element, index){
        if(marker == element) nowIndex1=index
    }
    markers.forEach(callback1)
    if(nowIndex1!='nowIndex1') markers.removeAt(nowIndex1)

    //delete path
    var nowIndex2='nowIndex2';
    function callback2(element, index){
        if(event.latLng == element) nowIndex2=index
    }
    path.forEach(callback2)
    if(nowIndex1!='nowIndex1') path.removeAt(nowIndex2)

    marker.setMap(null)

})

错误是“事件未定义”

所以我该怎么做 。

谢谢

4

1 回答 1

0

这个不好。它应该返回 DOM 的 mousedown 事件。我相信这是一个错误。我也尝试访问事件,因为我想在指针旁边放置一个菜单,所以我不得不使用框架给我指针的位置来完成将菜单放在标记旁边。

于 2010-07-20T15:38:55.513 回答