Leaflet.draw mapping: How to initiate the draw function without toolbar?
This simple code works for me: new L.Draw.Polyline(map, drawControl.options.polyline).enable(); Just put it into the onclick handler of your custom button (or wherever you want). The variables map and drawControl are references to your leaflet map and draw control. Diving into the source code (leaflet.draw-src.js) you can find the functions to draw the other elements and … Read more