确定多边形内标记的纬度 [英] Determine the lat lngs of markers within a polygon

查看:93
本文介绍了确定多边形内标记的纬度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个谷歌地图应用程序,它在加载时绘制标记。新的要求之一是添加包含用户选择标记的多边形覆盖图。我能够使用 GMaps实用程序库< a>

I have a google maps app which plots markers as it loads. One of the new requirment is to to add a Polygon overlay encompassing a selection of markers by the user. I was able to achieve that using the Geometry Controls of the GMaps Utility Library

现在,下一步是形成一组选定的标记,我需要确定标记的纬度是否落在纬度范围内多边形?有没有一种方法可以确定多边形的经纬度,并计算标记的纬度是否在其边界内?

Now, the next step is to form a group of the selected markers for which I would need to determine if the lat lngs of the markers falls within the lat lngs of the polygon? Is there a way to determine the lat lngs of a polygon and compute if the marker's lat lng is within its boundaries?

推荐答案

npinti的建议,你可能想要查看Google地图的以下多边形实现:

Following npinti's suggestion, you may want to check out the following point-in-polygon implementation for Google Maps:

  • Check if a polygon contains a coordinate in Google Maps

这篇关于确定多边形内标记的纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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