allow custom toolbar tooltips on EditControl component
I'd like to propose a new option to the EditControl component which allows to customize the tooltip shown when hovering on the draw buttons. Here's an example screenshot of what it looks like.
MWE:
from dash import Dash
import dash_leaflet as dl
app = Dash()
app.layout = [
dl.Map(
[
dl.TileLayer(),
dl.FeatureGroup(
[
dl.EditControl(
buttons={
"rectangle": "new tooltip",
},
),
],
),
],
center=[56, 10], zoom=6, style={"height": "50vh"},
)
]
if __name__ == "__main__":
app.run(debug=True)
This is a nice addition. And a neat PR. One question; is there a reason you only target the buttons property (there's are more, e.g. undo)? Or is it just the one needed for you use case?
No particular reasons. I was just looking at these tooltips for my use case. Indeed I guess there could be options for all buttons and one could possibly override the whole L.drawLocal object to change any default tooltips. But then, doing so could create a very complex argument to the function or there could be several new arguments such as the one I am proposing here. I'd be happy to modify the approach if you think this should be a worthy addition :)