i am using following function to load latlng of addresses From an array to array about 40, but it stops after 10 iterations.
loadStoreLatLong(40);
function loadStoreLatLong(i){
var paddress = store_locations[i]['address'] +','+store_locations[i]['postal_code'] + ', ' +store_locations[i]['district'] + ',' + store_locations[i]['country'];
var pgeocoder = new google.maps.Geocoder();
pgeocoder.geocode( { 'address': paddress}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
Storelatlong[i] = results[0].geometry.location;
i--;
if(i<0){
clientLocation();
}else{
loadStoreLatLong(i);
//var t = setTimeout("loadStoreLatLong("+(i)+")",1000);
//jQuery('#map_canvas').text('Loading ... '+i);
}
}
});
}
i am really stuck there, can any one help to figure it out, when i set time out 1000, this iterates fine 40 time, when i decrease the timeout, iterations also decreases and stop. thanks