Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get coordinates of a polygon in OpenLayers

I have been looking for how to determine coordinates of the points which consist a polygon(feature) in OpenLayers.

Let's say I have created a polygon like the one in this example. I need to know the points which consist the polygon, so I can save them somewhere.

I bet it is an easy one. I just couldn't find anything, probably I don't know what I should search for.

Thanks in advance.

like image 552
pars Avatar asked Oct 01 '10 05:10

pars


1 Answers

Found it finally!

vectors.features[0].geometry.getVertices()
like image 111
pars Avatar answered Sep 21 '22 07:09

pars