地理围栏功能-放置地图点,多边形,识别多边形内的点 [英] Geofencing feature - Place Map points ,polygon ,Identify point within polygon

查看:122
本文介绍了地理围栏功能-放置地图点,多边形,识别多边形内的点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对开放层中的多边形有两个查询.

I have two queries regarding Polygon in Open Layers.

1)我们如何在OS地图上放置一些点阵列?

1)How can we place some array of points on the OS map?

2)假设我们要绘制一个多边形.我们怎么知道这些点是否在多边形内部.简而言之,如果我们绘制多边形,我们将获取边界:如何识别点是否在多边形内?

2)Suppose we want to draw a polygon. How could we know whether the points are inside of the polygon or not. In short if we draw a polygon, we fetch the boundaries: How can we identify whether the points are inside the polygon or not?

任何人的帮助都将是我的初学者.

Any help would be appreciated as I am a beginner.

推荐答案

欢迎来到OpenLayers社区!

Welcome to the OpenLayers community!

1)参见以下示例,了解如何将点添加到地图: http://openlayers .org/en/v3.8.2/doc/tutorials/concepts.html

1) See this example to learn how to add point(s) to a map: http://openlayers.org/en/v3.8.2/examples/icon.html. I strongly suggest you also read the "concepts" tutorial: http://openlayers.org/en/v3.8.2/doc/tutorials/concepts.html

2)多边形对象具有intersectsExtent方法,可用于查看范围是否与范围相交.绘制多边形后,您可以在点阵列中循环并收集与多边形相交的每个点.请参阅文档: http://openlayers.org/en/v3.8.2 /doc/tutorials/concepts.html

2) A polygon object has the intersectsExtent method, which can be used to see if an extent intersects with an extent. After you have drawn the polygon, you could loop in the array of points and collect each one which extent intersects with the polygon. See the documentation: http://openlayers.org/en/v3.8.2/doc/tutorials/concepts.html

我将点和多边形分成2层,以使它们分开并更容易在点要素中循环.

I would separate the points and polygons into 2 layers to keep them separate and more easily loop in the point features.

这篇关于地理围栏功能-放置地图点,多边形,识别多边形内的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆