On Dec 20, 5:10 am, Arun <[email protected]> wrote: > I'm trying to invoke geocoder.getLatLng and pass a named function as: > > geocoder.getLatLng(stories[i].city, plotCity(response, stories[i], > map)); > > If I initialize var response; before getLatLng called then plotCity > shows the value of "response" as "undefined". If not, then function > invocation shows "latlng not defined". > > How can this be fixed ?
This is a similar query to http://groups.google.com/group/Google-Maps-API/browse_thread/thread/9a7fde97b547234c and the requirement does feature in the documentation. It appears that you can't pass your own arguments to a callback function, but you can gain access to them by using function closure. PS: Please, please post a link, not code. In your code snippet, as "latlng" doesn't appear anywhere, I'm not really surprised it's not defined! There is not really enough information there to do anything but point you in the direction of where to look for guidance. Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
