openstreetmap:检查latlong是否在面(区域)之外 [英] openstreetmap: check if a latlong is outside polygon(region)

查看:63
本文介绍了openstreetmap:检查latlong是否在面(区域)之外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 openstreetmap 上创建了一个区域(多边形),我想检查当前的经纬度是否在该多边形内.我正在使用 leafletjs .这是我的链接-> http://imaker.asia/leaflet/area.html

i have created a region(polygon) on openstreetmap and I want to check if my current lat-long is inside that polygon or not. I am using leafletjs. here is my link -> http://imaker.asia/leaflet/area.html

推荐答案

除了 https://之外,无需使用其他任何方法github.com/Leaflet/Leaflet api.只需使用polygon.getBounds().contains(e.latlng)函数

No need to use anyother than https://github.com/Leaflet/Leaflet api . Just use polygon.getBounds().contains(e.latlng) function

这篇关于openstreetmap:检查latlong是否在面(区域)之外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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