I want to show a JQuery UI dialog on top of a Leaflet map on page load.
When the page was loaded, the dialog was initialized but very shortly hidden behind the leaflet map if the map is 100% of the html page.
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;
}
Is this a bug with Leaflet or JQuery or something I did wrong?
Further question: what is the JS and UI framework that works best with Leaflet?