Javascript 传单不';t渲染贴图
我对传单有个奇怪的问题。这是我第一次使用这个图书馆,我不知道发生了什么Javascript 传单不';t渲染贴图,javascript,css,leaflet,Javascript,Css,Leaflet,我对传单有个奇怪的问题。这是我第一次使用这个图书馆,我不知道发生了什么 Here is the code: // right after <footer> tag <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <script> var map = L.map('cartomap').setView([51.505, -0.09], 13); L
Here is the code:
// right after <footer> tag
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script>
var map = L.map('cartomap').setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
</script>
// header
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css">
// content
<div id="cartomap" class="map"></div>
//style
.map {
width: 100%;
height: 300px;
}
我做错了什么?我应该把这个添加到我的CSS中吗?我认为我做错了什么,地图没有自动设置大小。在进一步挖掘之后,我终于发现了问题。传单不喜欢
最大宽度
和最大高度
。我不知道为什么。我刚刚在CSS中添加了以下内容:
.map-view img {
max-width: none;
max-height: none;
}
哪个浏览器/操作系统?看起来不错。
.map-view img {
max-width: none;
max-height: none;
}