在父容器重新调整大小时重绘google地图 [英] Redraw google maps on parent container resize

查看:147
本文介绍了在父容器重新调整大小时重绘google地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个google地图api v3在一个页面上,当放大到全窗口大小,它不会重绘本身。您可以这里查看问题

I've got a google map api v3 on a page and when enlarged to full window size it doesn't redraw itself. You can see the problem here

我看看人们在类似问题中说什么,我发现每个人似乎都用这行代码解决这个问题。

I've looked at what people say in similar questions and I found that everyone seems to be solving this problem with this line of code.

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

我试过了,但似乎没有帮助。

I've tried it, but it didn't seem to help. Your feedback is much appreciated.

推荐答案

似乎适合我...(见在这里

Seems to work for me... (see here)

基本上,只需添加 google.maps.event.trigger(map, resize'); 没有帮助,你可以在 map 对象上调用...

Basically, just adding google.maps.event.trigger(map, 'resize'); doesn't help, you call it on the map object you instantiated...

这篇关于在父容器重新调整大小时重绘google地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆