Hi Rossko,
Thanks for you reply. I don't think it's about scope. Scope has always
puzzled me but as far as I can tell, newBounds is being set in the
same scope as newBounds.getNorthEast() is being called.
I tried debugging by using alert(map.getCenter()) to tell if the
center moves after the infoWindow is opened and you're right: it
doesn't.
About your final remark: I don't want the map to zoom unexpectedly. I
just want the map to load with all markers visible and one infoWindow
opened. After loading my users should be able to move around the map
and open infoWindow (without bounds changing again) as they wish.
This is the page where I'm trying to achieve this:
http://www.degrensover.nu/.
My script is located at:
http://www.degrensover.nu/wp-content/themes/degrensover.nu/makemap.js
So, what should I try to do next? Wait till after the opening of the
infoWindow has panned the map to get the new top right corner and
setting bounds? Or is their another way of figuring out what the new
bounds should be?
Kind regards,
- Walter
On 10 okt, 12:13, Rossko <
ros...@culzean.clara.co.uk> wrote:
> > This results in the error "Uncaught TypeError: Cannot call method
> > 'getNorthEast' of undefined". What am I doing wrong here? Should I
> > follow a different strategy to achieve what I want?
>
> It's probably a variable scope error, not enough context to tell.
http://groups.google.com/group/google-maps-js-api-v3/t/2b3f101fd509919e