> Simple question to do with variable scope, when using something like
> GDownloadUrl

There isn't a GDownloadUrl in Maps API v3

> how do you access a gloabal variable i.e. populate the array in
> the example below?

You create some variable in global scope.
You populate the variable inside the callback code, without the use of
'var' so as to avoid creating a similarly named local-scope variable.

You can't use return because this is an asynchronous function, there
is nowhere to return to.

If you are having problems not seeing content of your gloabl array in
code outside of the callback, it's almost certainly because you have
overlooked its asynchronous nature and are trying to use data that
hasn't been returned yet.  If you want to do something with the data,
do it inside teh callaback code.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to