Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 433
Daniel Docki Avatar asked Apr 24 '12 13:04

Daniel Docki


1 Answers

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);
});
like image 172
roza Avatar answered Jan 03 '23 17:01

roza