 		var ll=markers[i].getPosition();
 		console.log(ll);
 
-if(google.maps.geometry.poly.containsLocation(ll, poly) == true) {
-
+if (google.maps.geometry.poly.containsLocation(google.maps.LatLng(ll.lat, ll.lon),polygons) == 'true'){
 
 		 console.log('inside');
 		} else{console.log('outside');}

       bounds.extend(extendPoint2);
    }


    	console.log('newbounds: ' + bounds);

	map.fitBounds(bounds);
}
function createMarker(p) {
	var cpa=p.split(",");

	for (var i=0; i < markers.length; i++) {
	   bounds.extend(markers[i].getPosition());
	}
	// Don't zoom in too far on only one marker
    if (bounds.getNorthEast().equals(bounds.getSouthWest())) {
       var extendPoint1 = new google.maps.LatLng(bounds.getNorthEast().lat() + 0.05, bounds.getNorthEast().lng() + 0.05);
