please could someone help me and bless me with an example of how to get coordinates from a polygon in OpenLayers?


you can get the coordinates of your shape as below code:


and also you can get covered area, centroid of your shape, vertices of ypur shape, length or geodesic area.

if you want specific feature bounds, you can write order of your feature [i] place like this:


and below code will give all bounds of your features example :

var ft = vectorLayer.features;
for(var i=0; i< ft.length; i++){

I hope that will be useful for you....

  • Please could you maybe give me an example of this as I am stuck. – Blake Loizides Feb 7 '12 at 14:22
  • @CaptDragon Question asked. lol. – Blake Loizides Feb 7 '12 at 21:15
  • @BlakeLoizides Aragon has it right. This is how you get coordinates from a polygon. In your comment on this question thought it seems like you're having trouble with deleting a polygon now? if so it's a separate question which would merit a new question entry. – CaptDragon Feb 7 '12 at 21:20


GetVertices returns the polygon POINT coordinates..


GetVertices() returns Polygon points coordinates

  • 3
    Can you improve (edit) your answer with further details? Thanks. – Antonio Falciano Oct 25 '13 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.