All kml loaded on map successfully. After that on search button i am finding that my location within KML polygon or not, but i am getting error " kmlLayerData.docs[0].gpolygons[0].Contains is not a function"
My code is :-
find_closest_kml:function (lat,lng,map) {
var point = new google.maps.LatLng(lat,lng);
if(kmlLayers.length){
kmlLayers.forEach(function(kmlLayerData){
for (var k=0; k < kmlLayerData.docs[0].gpolygons.length; k++) {
console.log(kmlLayerData.docs[0].gpolygons[k].Contains(point));
}
});
}
}
Hello Support, I have multiple kml so i parse kml filelike this :-
var kmlLayer new geoXML3.parser ({ map: map, singleInfoWindow: false, infoWindow: infowindow, suppressInfoWindows: true, zoom : false, locationslot: tmpltkml, afterParse: useTheData }); kmlLayer.parse(locations[i][14]); kmlLayers.push(kmlLayer);
All kml loaded on map successfully. After that on search button i am finding that my location within KML polygon or not, but i am getting error " kmlLayerData.docs[0].gpolygons[0].Contains is not a function"
My code is :- find_closest_kml:function (lat,lng,map) { var point = new google.maps.LatLng(lat,lng); if(kmlLayers.length){ kmlLayers.forEach(function(kmlLayerData){ for (var k=0; k < kmlLayerData.docs[0].gpolygons.length; k++) { console.log(kmlLayerData.docs[0].gpolygons[k].Contains(point)); } }); } }
Please help.