0

I'd like to set the draw control tooltip text in dash leaflet. The Leaflet.draw docs here, provide the following recipe:

// Set the button title text for the polygon button
L.drawLocal.draw.toolbar.buttons.polygon = 'Draw a sexy polygon!';

// Set the tooltip start text for the rectangle
L.drawLocal.draw.handlers.rectangle.tooltip.start = 'Not telling...';

Is there a way to do this in dash leaflet? Perhaps some javascript code to add these settings that could be run via a client-side-callback on page load? Or via dash-defer-js-import?

I tried using the L.drawLocal... recipe using via dash-defer-js-import, and got an error that drawLocal is not part of L. I inspected the members of L via Object.getOwnPropertyNames(L), and indeed drawLocal is not part of this.

I am also not sure if I should expect this to work, since all the Map etc objects have already been initialized by the time I am trying to apply the changes via L.drawLocal. It seems that the canonical way to do this in pure js is to modify L.drawLocal before instantiating the leaflet objects.

0

Browse other questions tagged or ask your own question.