谷歌地图不是完全呈现在div中? [英] Google map is not rendered fully in the div?

查看:83
本文介绍了谷歌地图不是完全呈现在div中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我在 div 内有 map_canvas ,称为 map 。问题是,当我增加 map 宽度时,一侧的google map没有完全渲染。 / p>

请帮忙

解决方案


地图区域的大小正在增加,但地图的右侧没有完全呈现。


当您更改div的大小,请在地图上触发resize事件:

从文档

事件


$ b 调整大小 - 开发人员应该在div更改大小时在地图上触发此事件:google.maps.event.trigger(map,'resize')。


Here I have the map_canvas within a div called map. The thing is when I increase the width of the map, the google map in one side is not rendered fully.

Please help

解决方案

The width of the map-area is increasing but the right side of the map is not rendering fully.

When you change the size of the div, trigger the resize event on the map:

from the documentation:

Events

resize - Developers should trigger this event on the map when the div changes size: google.maps.event.trigger(map, 'resize') .

这篇关于谷歌地图不是完全呈现在div中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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