I have 50 addresses in a database that need the geocodes long/lat
adding to new coloums on them and i am having trouble as the
"setSearchCompleteCallback" is not looping more than once.
I have triple checked my code and it will return the first geocoded
variable but on the second loop certain var fail as they say they are
undefined:
for (i in aAddresses){
var fullAddress = aAddresses[i][0]+ ", " +aAddresses[i][1]+ ", "
+aAddresses[i][2]+ ", " +aAddresses[i][3]+ ", " +aAddresses[i][4];
localSearch = new GlocalSearch(); ");
localSearch.execute(jQuery.trim(fullAddress) + ", UK");
localSearch.setSearchCompleteCallback(null, function(){
iLat = localSearch.results[0].lat;
iLong = localSearch.results[0].lng;
console.log(iLat);
});
}
Can anyone offer me a solution that makes the finding of geocodes
loopable?
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.