问题描述: var bounds=new google.maps.LatLngBounds(); for(var i=0; i<markers.length; i++){ window.map.fitBounds (bounds); } 当我们执行这时,谷歌地图上有些标记会消失。 产生原因: 谷歌地图像素渲染的问题导致的。 解决办法: 在执行fitBounds()后 执行 google.maps.event.addListener(map, 'idle', function() { map.panBy(0,0); });
但是,这意味着失去地图的好转,所以我在空闲事件上使用了panBy。 最终的解决方案是在创建地图后添加以下内容: