16

I create a map in a div with 'display: none'. With google maps v2 I could set the 'size' parameter to the size of the div once shown, but this 'size' option disappeared in v3 of the API.

How can I do that?

jul
  • 36,404
  • 64
  • 191
  • 318
  • possible duplicate of [How do I resize a Google Map with JavaScript after it has loaded?](http://stackoverflow.com/questions/743214/how-do-i-resize-a-google-map-with-javascript-after-it-has-loaded) – Guilherme Jan 12 '15 at 16:45

1 Answers1

33

Change the size of the div using any method you want, and then call google.maps.event.trigger(map, 'resize'). A related question is here.

Community
  • 1
  • 1
Sudhir Jonathan
  • 16,998
  • 13
  • 66
  • 90