这是我的代码:
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)
})
错误是“事件未定义”
所以我该怎么做 。
谢谢