Hi Daniel,

Sorry for the late reponse. I will try to explain my use case (my site
is not online yet). I'm developing a maps mashup that displays the
weather on the map. While the weather is loading I display a fullpage
map, when the weather has finished loading the map is resized so that
the map covers about 70% of the screen (in height, 100% width) and the
rest 30% displays a graph showing the weather temperature for the
coming 10 days. I also have a searchbox which enables the users to
search for a location. When the user performs a search the map is
centered to the new location, the graph hides while loading the
weather for the new location and I trigger the resize event on the map
since it's now in 100% height again. This is where the problem occurs.
When I trigger the resize the map goes back to the original location
before the search.

I temporarily solved the problem by waiting for the map idle event
before triggering the resize event.

I't won't work for me to trigger the resize eventfirst and the
setCenter() because of how the eventhandling works in my project (I do
alot of things when these events occur...).

Magnus

On Apr 15, 11:00 pm, Daniel Lee <[email protected]> wrote:
> Thanks for reporting this quirky behavior Magnus.
>
> Taking a step back, what's your general use-case for triggering the 'resize'
> event immediately after calling setCenter()?
>
> What happens when you trigger the 'resize' event first and then call
> setCenter()?
>
>
>
>
>
> On Tue, Apr 13, 2010 at 1:05 PM, Magnus O. <[email protected]> wrote:
> > Hi,
>
> > If I trigger setCenter() on the map and almost immediately after that
> > trigger the resize event on the map the map will never center on the
> > new point. If I listen to the "center_changed" event I can  see that
> > the center is quickly moved to the new point and then back to the
> > original center. The user will never notice this and the ui looks like
> > if it stays at the original point the hole time.
>
> > Anyone experience the same problem? Any ideas on how to I solve this?
> > If I put a timeout before triggering the resize event it works but
> > that not ideal for me.
>
> > Magnus
>
> > --
> > 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
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-maps-js-api-v3%2B 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
> --
> Daniel Lee
> Developer Programs Engineer
> Google, Inc.
> 345 Spear Street
> San Francisco, CA 94105
> 650 253 0967

-- 
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 [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-js-api-v3?hl=en.

Reply via email to