You can't pass arguments, but you can hold Function Closure on the
relevant variables:
var geocoder = new GClientGeocoder();
function addToMap(response) {
alert(noortekas.nimi);
// Retrieve the object
place = response.Placemark[0];
// etc...
}
function callGeocoder(noorrekas) {
geocoder.getLocations(noortekas.address, addToMap);
}
for(var i=0; i<noortekad.length; i++) {
callGeocoder(noortekad[i]);
}
In this code, the callGeocoder() function holds Function Closure on the
noorrekas variable, so it can be used in addToMap().
More info on Function Closure: http://econym.org.uk/gmap/closure.htm
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---