leaflet.wms
leaflet.wms copied to clipboard
support custom pane specification
Incorporate/enable/test the ability to specify a custom leaflet pane for a source (and it's underlying Overlay/Tile layer).
- Ordering WMS layers within a source is discussed in #19
- Ordering a WMS source among other leaflet layers is handled by #28 (edit: but see https://github.com/heigeo/leaflet.wms/issues/6#issuecomment-331259309)
See https://github.com/ptv-logistics/Leaflet.NonTiledLayer
Has any improvement on this been made yet? Tried to find a workaround on Stack Exchange but not found a solution. @sheppard did Leaflet.NonTiledLayer work for you?
This is still pending, PRs are welcome. I don't think it will be a huge change. I haven't tried Leaflet.NonTiledLayer directly but it appears they accept a pane
argument.
As discussed in #19, multiple sources can get out of order when panning and it's not clear that #28 is sufficient to address. Thus, panes are probably the easiest and most robust way to ensure that layer order remains the same when using multiple sources (c.f. esri/esri-leaflet#1000).
I ran into the same problem. I want to use a wms source (only one layer) as the basemap but it ends up on top of everything else.
So I think this should be filed as a bug not an enhancement.
For simple use case with a L.WMS.Overlay you may find this simple four-line patch relevant: https://github.com/GreenInfo-Network/leaflet.wms/blob/gh-pages/src/leaflet.wms.js#L405-L412
This is a patch into the L.WMS.Overlay update()
method, to look for a pane
option that was passed in, and move the resulting image overlay into the pane.
This does not address the more complex use cases, but hopefully someone using Overlay will find it useful.