Daniel Docki
Daniel Docki

Reputation: 103

How I get coordinates with drawing?

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

Answers (1)

roza
roza

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

Related Questions