On Mar 6, 2:58 pm, Ivan <[email protected]> wrote:
>
> What i managed to do is call the function on load time then again when
> i need to use it. Kind of redundant but it works

That's because of the asynchronicity. You're effectively pre-fetching
the data and it's arrived by the time you need it. Although it appears
it works for you at the moment, it may not work if you change your
code, and it definitely won't work in all cases.

The correct way to handle an asynchronous service is with a callback
function.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to