如果地图的高度较大,街景视图无法正确显示图像

时间:2013-03-25 10:12:24

标签: css google-maps google-maps-api-3 google-street-view

我根据以下

使用了街景
/* Map html */
<div id="mapDiv" class="">
    <div id="map-holder">
    <div id="map_canvas" class="bigmap"></div>
    <div id="map_stv" class="minimap" style="display: none"></div>
    </div>
</div>

/* Css associated */
.bigmap{
    width:100%;
    height:100%;
}

.minimap{
    width:50%;
    height:100%;
}
#map_stv {
    position: absolute;
    top: 0;
    right: 0;
}
#map_stv img {
    border: none !important;
    max-width: none !important;
}

当我需要显示街景时,我将minimap类添加到map_canvas并切换map_stv。它的工作正常。但是当地图的尺寸​​是768x1024时,我得到以下问题

enter image description here

有人遇到过这个吗?关于这个的任何指示?

1 个答案:

答案 0 :(得分:1)

I made a fiddle for you!

问题是,你的地图是否因图像拉伸太远而导致街景图像的顶部被切断。

为了使您的地图能够快速响应,我刚刚添加了:

style="width: 99%; height: 99%;

#map-holder div。

总之,我最好的选择是尝试在地图widthheight

中坚持或多或少均匀的宽高比