多边形完全无法显示v3的lat long值

时间:2013-02-25 18:59:31

标签: google-maps-api-3

我正在从V2 gmap迁移到V3。我需要单独绘制折线,多边形和点以标记地理围栏区域。在绘图完成后的我的v2中,我得到一个弹出窗口并添加必要的细节并能够保存到db。现在我设法使用绘图工具,我有这个功能。 lat和long值的问题没有显示,因此我无法向我的infowindow显示任何帮助。我需要折线和标记。

示例代码。

    var points = e.getPath();
    alert("POL COMPLETE"+points.length);
    var latlngbounds = new google.maps.LatLngBounds();

     for (var i =0; i < points.length; i++) {
                var xy = points.getAt(i);
                alert("Coordinate: " + i + "<br />" + xy.lat() +"," + xy.lng());
                latlngbounds.extend(points(i)); 
     }

    alert("CS : "+latlngbounds.getCenter());
var contentString="TESTTT";
         var infowindow = new google.maps.InfoWindow({
    content: contentString
});
          infowindow.setPosition(latlngbounds.getCenter());
        infowindow.open(map);

              var newShape = e.overlay;
              selectedShape = newShape;

            google.maps.event.addListener(infowindow,'closeclick',function(){
           alert("TEST");
           selectedShape.setMap(null); //removes the marker
   // then, remove the infowindows name from the array
});

0 个答案:

没有答案
相关问题