On Mar 29, 7:04 am, vincent <[email protected]> wrote:
> @Andrew
> thanks a lot - and of course you are 
> right!http://www.weltmeer.ch/divelog/index1.php
> now it works - to show it - but it is not working like i hoped or
> would expect.
> When selecting the country it shoul zoom to the country and still be
> showing the dives.

In that case you need not to create a new map!

You have a global variable map1
  var map1=null;
which is correct.

In function initialize, you create a local variable to refer to the
map:
  var map1 = new GMap2(...)
which does not use the global variable. That means that the "map1"
which refers to the map is only available while that function is
executing. Remove the "var" keyword so you assign the value to the
global variable.

In function centerAndZoomOnBounds, you have:
  var map1 = new GMap2(...)
which creates a new map, and assigns to another local variable called
"map1". Because it's a new map, it doesn't have any of your markers on
it. Remove that line from within function centerAndZoomOnBounds, and
the following five lines. The function will then use the global
variable map1, and change the map which contains your markers. You
only need that function to alter the view of the map, not add all the
controls. In fact that function looks very like something I wrote, and
I don't think I would have added all that stuff.

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