2016-09-25 45 views
0

我尽力从不同的答案中解决问题,但我的问题依然存在。 地图显示不正确。灰色框架占据了框架的近3/4。 How the map shows up传单地图不能正确显示。部分灰色。

<div id="map"></div> 

<script> 

var map = L.map('map',{scrollWheelZoom: false}); 
map.setView(<%= @location.latlng %>, 16); 
marker = L.marker(<%= @location.latlng %>).addTo(map); 
L.tileLayer('http://a.tile.osm.org/{z}/{x}/{y}.png', { 
      attribution: 'Your attribution statement', 
         maxZoom: 20, 
         subdomains: '', 
         }).addTo(map) 
$(document).ready(function(){ 
    L.Util.requestAnimFrame(map.invalidateSize,map,!1,map._container); 
}); 
</script>  

回答