how to deal with google map inside of a hidden div (Updated picture)

leora picture leora · Oct 31, 2010 · Viewed 116.5k times · Source

i have a page and a google map is inside a hidden div at first. I then show the div after i click a link but only the top left of the map shows up.

i tried having this code run after the click:

    map0.onResize();

or:

  google.maps.event.trigger(map0, 'resize')

any ideas. here is an image of what i see after showing the div with the hidden map in it.alt text

Answer

Eric picture Eric · Jul 30, 2011

I was having the same problem and discovered that when show the div, call google.maps.event.trigger(map, 'resize'); and it appears to resolve the issue for me.