谷歌地图切断铬

时间:2013-04-04 12:58:43

标签: google-chrome google-maps-api-3

googlemaps js api我遇到了一个奇怪的问题。我生成了一张地图,它在所有浏览器中完美显示,但是在chrome中。在那里它以某种方式切断或缩放太多,以便左侧的控件被切断。

请参阅此屏幕截图:enter image description here

我搜索了问题,但找不到工作解决方案,添加

google.maps.event.trigger(map, "resize");
像我在几个线程中读到的那样没有帮助..

这是我的代码:

JS:

var myLatlng = new google.maps.LatLng(52.458641, 13.380887);
  var myOptions = {
    zoom: 15,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("Map"), myOptions);
  marker = new google.maps.Marker({
        position: myLatlng,
        map: map
    });
    google.maps.event.trigger(map, "resize");

html:

<div id='Map'></div>

的CSS:

#Map {
width: 250px;
height: 250px;
border: 1px solid #000;
float: right;

}

1 个答案:

答案 0 :(得分:0)

我在这个帖子中找到了解决方案,感谢geocodezip:Zoom control and streetview not showing on my Google map?

添加

#Map img {
max-width: none;
}

给css做了伎俩。

相关问题