0

If I have an area defined (Polygon, image boundary, etc.) I want to be able to alert the user if their current position is outside of the geographic location / geofenced area in Google Maps. I am able to determine the location of the user through HTML5 geolocation fine, I just need to know how to display an alert if the user is using the webpage outside of the designated area. First time poster, please go easy on me. :)

4

2 回答 2

1
  1. 使用 google maps api加载几何库。
  2. 使用containsLocation 实用程序方法确定用户的当前位置是否在您的地理围栏区域内。
  3. 向用户显示警报。

对于警报本身,您有多种选择。最简单的方法是使用标准的 javascriptalert调用。您还可以使用地图 apiinfowindow甚至 3rd 方灯箱覆盖。

于 2013-08-24T11:01:52.200 回答
0

检查这个....

Google-Maps-Point-in-Polygon

于 2013-08-24T17:55:57.467 回答