开发者

How to set map size in Google Maps API v3?

开发者 https://www.devze.com 2023-01-18 20:21 出处:网络
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

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消