how to get coordinates of a polygon in OpenLayers

自古美人都是妖i 提交于 2019-11-29 09:36:49

问题


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.


回答1:


Found it finally!

vectors.features[0].geometry.getVertices()


来源:https://stackoverflow.com/questions/3836676/how-to-get-coordinates-of-a-polygon-in-openlayers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!