I've been using Leaflet 0.7.3 very successfully with jQueryUI. It is clear that the z-index values or logic has changed in 1.beta, as my own divs that were once working are now overlaid by Leaflet and jQueryUI modal dialog boxes are hidden underneath the map pane.
cc @patrickarlt
Yeah, the z-index values were bumped. Can you set up a JSFiddle to demonstrate the problem?
I don't know about jQueryUI, but I had some divs over my map.
After updating to 1.0 beta 1 the were below the map so I just increased the z-index on my divs and it worked fine.
It's obvious how to modify my own CSS to give DIVs a larger z-index, but the issue is compatibility with a large library like jQueryUI, which had no previous problems. It's not reasonable to have to modify the jQueryUI code itself to enable inter-operability, though I haven't looked yet for means of specifying the use of z-index values for modals and other widgets -- I'm going to look this morning.
Regardless, the usage and values of z-index in Leaflet needs to be well documented in order for developers to anticipate such issues.
This entry may help those with this problem: http://stackoverflow.com/questions/16917430/jquery-ui-1-10-dialog-and-zindex-option
So, any chance to see a JSFiddle?
See fiddle here: https://jsfiddle.net/onwu4kv6/
Seems like by default jQueryUI dialog z-index is 100 and default map pane has a z-index of 400.
This can be worked around very easily by manually specifying a lower z-index for the map.
The underlying problem is that the map panes share the same stacking context as the siblings of the map container. So it's not the z-index of the map container, it's the z-index of the panes.
I'm partial to add a isolation: isolate CSS rule to .leaflet-container, as this allows the map containers to forcefully have their own stacking context without forcing a specific z-index. Or set z-index:0 altogether so it works on IE also.
@jaymmartin Thanks for the fiddle!
@IvanSanchez Why "partial to add isolation: isolate; and not just add it? What would be a reason not to?
@jieter Browser support. See https://developer.mozilla.org/en-US/docs/Web/CSS/isolation#Browser_compatibility
I just encountered a similar problem, with the leaflet map covering my hovering menu bar.
A simple fix could be to just add .leaflet-container {z-index:0} to the leaflet.css stylesheet. No?
Most helpful comment
This can be worked around very easily by manually specifying a lower
z-indexfor the map.The underlying problem is that the map panes share the same stacking context as the siblings of the map container. So it's not the z-index of the map container, it's the z-index of the panes.
I'm partial to add a
isolation: isolateCSS rule to.leaflet-container, as this allows the map containers to forcefully have their own stacking context without forcing a specific z-index. Or setz-index:0altogether so it works on IE also.@jaymmartin Thanks for the fiddle!