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
> The business with 'newBounds' wouldn't do anything useful anyway, no
> infowindow has changed anything yet. You'd need to delay that until
> after the infowindow action has finished panning, if it does.
>
> You might like to to think about whether your users will be more
> familiar with, or would prefer, a map that moves to accomodate an
> infowindow or a map that zooms unexpectedly.

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