Hi, I’m hoping for some advice, and will put together a minimal example if it will help.
I have on a Dash Leaflet map:
- a GeoJSON layer with shading
- a ColorBar (in front of it)
The GeoJSON shading can flip between a choropleth and showing selected countries (in response to radio buttons), and I’d like to hide the ColorBar when showing selected countries.
At the moment I do this by setting its opacity=0.0, but this has the problem that the invisible ColorBar still appears to mask hover and click events - if the mouse is over the ColorBar position the GeoJSON tooltip doesn’t show and the GeoJSON doesn’t respond to click events. (Both work perfectly when the mouse cursor is away from the ColorBar location).
Is there a good way of solving this? I think my next step is probably to find a way of changing the z-index of the ColorBar (setting style={“z-index”:“0”} seems to have no effect). I’m a bit reluctant to remove/replace map layers in response to a callback, but I think I may be missing some more straightforward solution.