ipyleaflet
ipyleaflet copied to clipboard
Selecting layer puts it on top of layer stack
I have a map with two layer groups of markers. These markers are plotted directly on top of one another. I use one of these layers to color code the other based on a value tied to the location and actually intended to have multiple layers like this. I can control the initial order of which layer is on top of the stack by controlling how they are added to the map (first to last, bottom to top). However, if I disable a layer in the layer control and then enable it, regardless of where it was in the stack initially, it now becomes the top layer. This changes the appearance of the layered markers and which layer can be selected (only top layer can be selected).
Is this something that can be changed? After doing a bit of searching, it seems this is the behavior in leafletjs, so I'm not sure anything can be done about it in ipyleaflet. And perhaps my use case is poor practice and I should consolidate my layers into one--by doing that I will have some repeated code / functionality in multiple layers.