【发布时间】:2018-07-29 04:31:28
【问题描述】:
我想在页面加载时在 Leaflet 地图上显示一个 JQuery UI 对话框。
加载页面时,对话框已初始化,但如果地图是 html 页面的 100%,则该对话框很快隐藏在传单地图后面。
HTML:
<div id="dialog" title="Basic dialog">
<p>JQuery UI Dialog</p>
</div>
<div id="map"></div>
JS:
var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {
maxZoom: 18,
attribution: osmAttrib
});
// initialize the map on the "map" div with a given center and zoom
var map = L.map('map').setView([19.04469, 72.9258], 12).addLayer(osm);
$( function() {
$( "#dialog" ).dialog();
} );
CSS:
#map {
height: 200px;
width: 500px;
}
这是 Leaflet 或 JQuery 的错误还是我做错了什么?
再问:什么 JS 和 UI 框架最适合 Leaflet?
【问题讨论】:
标签: javascript jquery jquery-ui leaflet