Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/437.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 传单不';t渲染贴图_Javascript_Css_Leaflet - Fatal编程技术网

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: '&copy; <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;
}