as dash-leaflet still has no dl.Legend (or at least I am not aware of it, one way to add legend it is with predefined image), but is it possible to add callbacks to the dl.Overlays which contains the data shown on the dl.Map and show legend only on these Overlays which are checked.
I made an dl.Overlay(dl.GeoJSON(url=geojson, id=‘links-ch2th02-1’, checked=True) and later added the callback to it:
msg = [html.H3(‘Legend’)]
msg+=[dbc.Row(‘My detailed legend’)]
but when uncheck the Overlay in the map, ‘My detailed legend’ still exist as a text.