leaflet.wms icon indicating copy to clipboard operation
leaflet.wms copied to clipboard

support custom pane specification

Open sheppard opened this issue 10 years ago • 6 comments

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)

sheppard avatar Oct 14 '14 21:10 sheppard

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

sheppard avatar Nov 04 '14 17:11 sheppard

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?

joshdickerson92 avatar Feb 29 '16 21:02 joshdickerson92

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 avatar Aug 19 '16 17:08 sheppard

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

sheppard avatar Sep 21 '17 19:09 sheppard

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.

peter-alexander avatar Oct 11 '17 20:10 peter-alexander

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.

gregallensworth avatar Dec 11 '20 20:12 gregallensworth