[jQT] Redrawing Google Maps in v3

3,165 views
Skip to first unread message

Jason

unread,
May 12, 2010, 8:50:39 PM5/12/10
to jQTouch
If you are having trouble getting a v3 google map to correctly redraw
when displaying it after the first time, here's a line to fix it:

google.maps.event.trigger(map, 'resize');

This took me hours to find -- hope it helps someone else.

Thanks,

-Jason

mrp...@gmail.com

unread,
May 14, 2010, 1:51:48 PM5/14/10
to jQTouch
I'm having a similar problem with google maps v3: the map loads
perfectly the first time, but after the div gets hidden and
redisplayed (by going "back" and selecting a different location), the
map is zoomed way out and centered on the equator/South America.
This happens whether I unbind/remove the map-canvas div, or leave it
be (it just takes longer to load when the entire canvas div and map
has to be regenerated). The 'resize' trigger also has no effect.

Other than the map center/zoom being wrong, the map works okay, my
markers are there and everything. The zoom/center is just always wrong
when a div is reloaded.

diego gullo

unread,
Nov 8, 2012, 7:53:56 AM11/8/12
to jqt...@googlegroups.com
I see the same problem, is there a fix for this? 
I tried with 

google.maps.event.trigger(map, 'resize'); but it doesnt work

David Schovanec

unread,
Mar 13, 2013, 9:46:31 AM3/13/13
to jqt...@googlegroups.com
It really helps! Thanks

Dne čtvrtek, 13. května 2010 2:50:39 UTC+2 Jason napsal(a):
Reply all
Reply to author
Forward
0 new messages