Question

I'm trying on this tutorial and now i need to get the coordinates of the points of the polygon that i draw here. Please someone explain how can i get the coordinates.

Était-ce utile?

La solution

After the

drawingManager.setMap(map);

I added ​​

google.maps.event.addListener(drawingManager, 'polygoncomplete', function (polygon) {
    var coordinates = (polygon.getPath().getArray());
    // console.log(coordinates);
    window.alert("success"+coordinates);
});

Thanks david strachan.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top