heigeo / leaflet.wms

A Leaflet plugin for working with Web Map services, providing: single-tile/untiled/nontiled layers, shared WMS sources, and GetFeatureInfo-powered identify.
http://heigeo.github.io/leaflet.wms/
MIT License
242 stars 135 forks source link

support custom pane specification #6

Open sheppard opened 9 years ago

sheppard commented 9 years ago

Incorporate/enable/test the ability to specify a custom leaflet pane for a source (and it's underlying Overlay/Tile layer).

sheppard commented 9 years ago

See https://github.com/ptv-logistics/Leaflet.NonTiledLayer

joshdickerson92 commented 8 years ago

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?

sheppard commented 8 years ago

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.

sheppard commented 6 years ago

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).

peter-alexander commented 6 years ago

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.

gregallensworth commented 3 years ago

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.