javascript - Google Map Api - IE - 大小 map

标签 javascript css internet-explorer google-maps-api-3

我使用 Google Map API v3,但只有 IE 有问题。

我有一个包含 2 个 block “table-cell”的 block “table”。在表格单元格中,我有 map ,但我没有看到 map 。

问题是高度为 100% 的 block “gm-style”,我们看不到 map 。 如果我将高度更改为 250 像素(示例),我们会看到 map 。

我怎样才能用 block “table”和“table-cell”调整这个 block 的高度?

谢谢!

Example here on jsfiddle

<style>
.table { 
    width: 100%; 
    display: table; 
}
.table-cell {
    display: table-cell;
    width: 50%;
    vertical-align: top;
}

</style>
<script src="//maps.googleapis.com/maps/api/js?v=3"></script>
<div class="table">
    <div class="table-cell" id="map"></div>
    <div class="table-cell" style="height: 250px;">
        Cell 2
    </div>
</div>
<script>
// Create map
map = new google.maps.Map(document.getElementById('map'), {
    zoom: 4,
    center: new google.maps.LatLng(-30, 145.5),
    mapTypeId: google.maps.MapTypeId.ROADMAP
});
</script>

最佳答案

我认为 IE 在将 Google map 显示为 display: table-cell;

时出现问题

我将 Google map 推到一层,它似乎可以正常工作。也看看这个:http://jsfiddle.net/1s5d0f5d/1/

关于javascript - Google Map Api - IE - 大小 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31691360/

相关文章:

javascript - 从 Django 中同一页面上的多个按钮发起 AJAX 请求

javascript - 如何禁用 jquery 数据表上的拖放

html - 为什么 transform with transition 会导致整个页面重绘?

jquery - 可能显示 :none this without JavaScript?

html - 表与位置 : absolute in IE (not Chrome) 不对齐

javascript - element.onclick 返回 null 而 element.getAttribute ('onclick' ) 不

javascript - 错误 : Package exports for tslib do not define a valid '.' target

html - 如何在表格 html 的 td 内给出边距?

html - 表格中的 SVG 在 Internet Explorer 中不缩放

c# - 我如何在win7上通过c#修改注册表?