My code is not live yet so can't post the link but here is the pastie link (with entire code):
http://pastie.org/344752 And finally figured out how to use closures to achieve the business logic :) I'll post a comment again after the code will go live. -Arun On Dec 20, 6:12 pm, "warden [Andrew Leach - Maps API Guru]" <[email protected]> wrote: > 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 > tohttp://groups.google.com/group/Google-Maps-API/browse_thread/thread/9... > 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 -~----------~----~----~----~------~----~------~--~---
