forked from mattwilliamson/Google-Maps-Point-in-Polygon
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added checking support for a pair of lat/lng numbers with slight touc…
…h on the README.
- Loading branch information
Jay Chae
committed
Feb 23, 2013
1 parent
f1ed6ca
commit edddcbb
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Google-Maps-Point-in-Polygon | ||
------------------------ | ||
|
||
A Javascript Google Maps v3 extension for the Polygon class to detect whether or not a point resides within it. | ||
|
||
Usage: | ||
------------------------ | ||
- Check if a LatLng object resides within the polygon. | ||
``` | ||
var coordinate = new google.maps.LatLng(40, -90); | ||
var polygon = new google.maps.Polygon([], "#000000", 1, 1, "#336699", 0.3); | ||
var isWithinPolygon = polygon.containsLatLng(coordinate); | ||
``` | ||
|
||
- Or, check if a pair of lat,lng resides within the polygon without creating a Marker object | ||
|
||
``` | ||
var polygon = new google.maps.Polygon([], "#000000", 1, 1, "#336699", 0.3); | ||
var isWithinPolygon = polygon.containsLatLng(40, -90); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters