I am making geocoding requests from client-side for an array of 25 addresses and received this error for 14 of them. Here's my code, with what I thought would be enough of a delay:
$(function() {
var addresses = ["... bunch of addresses..."];
var geocoder = new google.maps.Geocoder();
var outputContainer = $('#resultsContainer');
addresses.forEach(function(address) {
setTimeout(function() {
geocoder.geocode({
'address': address
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
outputContainer.append('<p>' + address + ' : ' + results[0].geometry.location.A + ' , ' + results[0].geometry.location.k + '</p>');
} else {
outputContainer.append('<p>' + address + ' : Not found, Status: ' + status.toString() + '</p>');
}
});
}, 4000);
});
})
I'm very likely missing something here, but can't for the life of me think of what at the moment. Any suggestions?