Reputation: 103
Folks,
I have this code https://gist.github.com/2473387
But, how do I get the coordinates of the polygon drawn?
Upvotes: 9
Views: 9993
Reputation: 585
I suggest to add 'polygoncomplete' listener on DrawingManager and get coordinates from polygon MVCArray.
google.maps.event.addListener(drawingManager, 'polygoncomplete', function (polygon) {
var coordinates = (polygon.getPath().getArray());
console.log(coordinates);
});
Upvotes: 20