I am having troubles getting geo location info from google maps api
the code is pretty straight forward
$.ajax({
type: \"GET\",
cache: false,
function codeAddress(address, title, imageURL) {
console.log(address);
geocoder.geocode({'address': address}, function (results, status) {
console.log(results);
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
icon: "",
title: title
});
/* Set onclick popup */
var infowindow = new google.maps.InfoWindow({content: title});
google.maps.event.addListener(marker, 'click', function () {
infowindow.open(marker.get('map'), marker);
});
}
else if (status === google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
setTimeout(function () {
codeAddress(address, title, imageURL);
}, 250);
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});