Skip to content

Updated version of Matt Williamson's Point in Poly, to work with Gmaps API V3

Notifications You must be signed in to change notification settings

strongwazz/Google-Maps-Point-in-Polygon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

This is a Javascript Google Maps extension for the GPolygon class to detect whether or not a point resides within it. Included is a sample HTML page that makes use of it to demonstrate usage.

<http://appdelegateinc.com/blog/2010/05/16/point-in-polygon-checking/>

Simplest Usage:

var coordinate = new google.maps.LatLng(40, -90);
var polygon = new google.maps.Polygon([..paths..], "#000000", 1, 1, "#336699", 0.3);
var isWithinPolygon = polygon.containsLatLng(coordinate);

Or if you have a Marker


var isWithinPolygon = polygon.containsLatLng(marker.getPosition());

About

Updated version of Matt Williamson's Point in Poly, to work with Gmaps API V3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%