On 8 February 2011 15:23, xelawho <[email protected]> wrote:
>> Unfortunately it's difficult to be sure -- your indentation and use of
>> { } is all over the place!
>
> yes, sorry about the messy markup - that's definitely on my To Do
> list.
>
> ... it is in the initialize() function, but I was under the impression
> that anywhere where you're creating a new object (in this case the
> google.maps.LatLngBounds), that has to be in the initialize. Not so?

Definitions of functions and objects which are intended to be used in
more than one place must be global. Assignment of objects to variables
can be in initialize() if you want.

var myObject;  // define global variable
function initialize() {
  myObject  = new ...; // assign to global variable
  }
function myZoomFunction() {
  // function in global scope
  }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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