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.
我使用'display:none'在div中创建一个地图。使用google maps v2,我可以将'size'参数设置为div显示的大小,但这个'size'选项在API的v3中消失了。
How can I do that?
我怎样才能做到这一点?
1 个解决方案
#1
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.
使用您想要的任何方法更改div的大小,然后调用google.maps.event.trigger(map,'resize')。一个相关的问题在这里。
#1
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.
使用您想要的任何方法更改div的大小,然后调用google.maps.event.trigger(map,'resize')。一个相关的问题在这里。