这是一个我无法弄清楚的超奇怪的问题.我有我的div与地图和它的CSS风格.Leaflet地图显示在一个矩形中,而不是div中.它好像z索引是错误的,但我无法弄明白.JS位于document.ready函数中.我在地图div周围添加了一个边框,以显示一切都是如何.

CSS:
#map {width:100%;height:100%;margin-left:10px;margin-top:40px}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div id="showTravel" class="row" style="display:none">
<div class="col-lg-12">
<div class="wrapper wrapper-content">
<h2 style="margin-top:-18px">All Travelers</h2>
<div id="travelContent">
<div id=map></div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
JS:
var map=L.map('map',{
minZoom:2,
maxZoom:18
}).setView([x,y],16);
var buildingIcon=L.icon({
iconUrl:'/images/bicon.png',
iconSize:[25,40],
popupAnchor: [-3, -20],
iconAnchor: [14, 38]
});
L.marker(x,y],{
icon:buildingIcon,
title:'town, state'
})
.bindPopup('<b>first last</b><br>Email: email address<br>Cell: phone number')
.addTo(map);
mapLink='<a href="http://openstreetmap.org">OpenStreetMap</a>';
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data © ' + mapLink,
maxZoom:18
}).addTo(map);
Run Code Online (Sandbox Code Playgroud)
我已经解决了重叠问题,但最后一个问题仍然存在,即
当页面加载并且地图在地图上呈现时,document.ready()只能在屏幕的左上角看到.如果我更改浏览器的大小(最大化,最小化),则地图会正确刷新.
我有一个 PHP 数组,其中包含 2-5 个项目。
$z=["itema", "itemb", "itemc", "itemd","iteme"];
Run Code Online (Sandbox Code Playgroud)
我需要一种方法来遍历数组并将每个项目相互匹配一次。所以输出看起来像
itema vs itemb
itema vs itemc
itema vs itemd
itema vs iteme
itemb vs itemc
itemb vs itemd
itemb vs iteme
itemc vs itemd...ect
Run Code Online (Sandbox Code Playgroud)
我似乎无法让循环击中每个项目。我认为它必须是一个循环中的循环,因为我只有一个循环不起作用。
并且它必须只去每个地方一次。我对如何让它发挥作用感到非常迷茫。任何帮助将非常感激。