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.

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top