Google Maps V3: polygon vertices

google-maps-api-3polygon

Does anybody know how to get an array of the vertices of a polygon built using the new drawing library?
http://gmaps-samples-v3.googlecode.com/svn/trunk/drawing/drawing-tools.html

I have tried with newShape.getPath().getArray()[0].lat(), but this seems to be empty

Best Answer

I didn't have any problem with newShape.getPath().getArray()[0].lat(). If newShape polygon object is not null and the vertices weren't removed from the path, it should work.

You can also try newShape.getPath().getAt(0).lat(), it should work as well.

There must be some other problem in your code.

Related Topic