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. :)
containsLocation
utility method to determine if the user's current location is within your geofenced area.For the alert itself, you have several options. The easiest way is to use a standard javascript alert
call. You could also use a maps api infowindow
or even a 3rd party lightbox overlay.
check this....