CSS如何阻止Google地图加载? [英] How can CSS stop Google Maps loading?

查看:116
本文介绍了CSS如何阻止Google地图加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带Google Maps div的页面:

 < div id =map_canvasstyle =width: 100%;身高:332px; >< / DIV> 

如果我注释掉我的CSS,地图加载正常:如果我包含CSS,地图控件加载,但地图块不加载:只有一个灰色背景。



即使我将地图div放在<$ c $之后,情况也是如此c>< body> 标签,根本不在任何样式元素中。没有CSS,它加载正常。用CSS,没有地图。

有谁知道可能是什么原因造成的?如果没有CSS样式应用于任何包含地图的元素,我不太明白问题所在。



如果需要更多诊断,请让我我知道,我会将破碎的地图部署到暂存站点,以便人们可以查看源代码。



更新:好的暂存网站在这里 - 这是一团糟,但地图应该加载。

解决方案

它是您在global.css文件中设置的overflow:hidden样式。删除它,它就像一个魅力。

  div,p {
overflow:hidden;
}


I have a page with a Google Maps div:

<div id="map_canvas" style="width: 100%; height: 332px;" ></div>

If I comment out my CSS, the map loads fine: if I include the CSS, the map controls load, but the map tiles don't load: there's just a grey background.

This is the case even if I put the map div just after the <body> tag, not within any styled element at all. No CSS, it loads fine. With CSS, no map.

Does anyone know what could be causing this? I don't quite understand what the problem can be if no CSS styles are being applied to any element that contains the map.

If more diagnostics are needed, please let me know, and I'll deploy the broken map onto a staging site, so people can look at the source.

UPDATE: OK, the staging site is here - it's a mess, but the map should load.

解决方案

It is the overflow: hidden style you have set in your global.css file. remove that and it worked like a charm.

div, p {
    overflow:hidden;
}

这篇关于CSS如何阻止Google地图加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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