如何在 OpenLayers 中获取多边形的坐标 [英] how to get coordinates of a polygon in OpenLayers
本文介绍了如何在 OpenLayers 中获取多边形的坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在寻找如何确定 OpenLayers 中包含多边形(特征)的点的坐标.
I have been looking for how to determine coordinates of the points which consist a polygon(feature) in OpenLayers.
假设我创建了一个类似于 this 示例中的多边形.我需要知道构成多边形的点,以便将它们保存在某个地方.
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.
提前致谢.
推荐答案
vectors.features[0].geometry.getVertices()
这篇关于如何在 OpenLayers 中获取多边形的坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文