Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps V3: polygon vertices

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

like image 599
Adrien Hingert Avatar asked Aug 08 '26 13:08

Adrien Hingert


1 Answers

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.

like image 126
Tomik Avatar answered Aug 11 '26 12:08

Tomik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!