1

我想在使用 google maps api v3 的绘图管理器绘制后单击折线,我尝试使用此代码,但它不起作用!如何?

google.maps.event.addListener(drawingManager, 'overlaycomplete', function(event) { 
if(event.type == google.maps.drawing.OverlayType.POLYLINE){ 
    var newPolyline = event.overlay;                        
    var info = "Testing";
google.maps.event.addListener(newPolyline, 'click', function(){
    infowindow.setContent(info);
    infowindow.open(map, this);
});
polylines.push(newPolyline);
}
});
4

0 回答 0