【发布时间】:2010-10-15 15:21:46
【问题描述】:
【问题讨论】:
标签: api google-maps polygon point-in-polygon
【问题讨论】:
标签: api google-maps polygon point-in-polygon
Google 已经提供了一个
var bermudaTriangle = new google.maps.Polygon({
paths: [
new google.maps.LatLng(25.774, -80.190),
new google.maps.LatLng(18.466, -66.118),
new google.maps.LatLng(32.321, -64.757)
]
});
google.maps.event.addListener(map, 'click', function(event) {
console.log(google.maps.geometry.poly.containsLocation(event.latLng, bermudaTriangle));
});
https://developers.google.com/maps/documentation/javascript/geometry#containsLocation
【讨论】:
是的,这是可能的。看到这个函数:http://github.com/tparkin/Google-Maps-Point-in-Polygon
【讨论】: