Como usar o containsLocation na biblioteca de geometria do Google Maps.
Eu estou tentando usar ocontainsLocation
da biblioteca de geometria do Google, mas não consegue fazê-lo funcionar ...
var point = new google.maps.LatLng(51.331, 3.538);
var poly = [
new google.maps.LatLng(51.401818509550615, 3.547626782103622),
new google.maps.LatLng(51.397574277049365, 3.563607598960424),
new google.maps.LatLng(51.398540111384975, 3.567880788749134),
... // it is a lot bigger
];
if(google.maps.geometry.poly.containsLocation(point, poly) == true) {
alert("yes");
}
O console Javascript dá um erro, mas isso aponta para uma função na biblioteca do Google. Então eu assumo que o problema deveria estar em algum lugar nessa função.