Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.97k stars 992 forks source link

Using leaflet draw without toolbar #812

Open lpeppe opened 6 years ago

lpeppe commented 6 years ago

Hey, I'm trying to use this plugin to allow users to draw a circle on the map after pressing a custom button in my app UI but I can't understand how to do it. Is there a way to use a custom button to start the drawing, instead of relying on the default toolbar?

EDIT: I managed to make it work using this post: https://stackoverflow.com/questions/15775103/leaflet-draw-mapping-how-to-initiate-the-draw-function-without-toolbar

now I have one more question: is it possible to hide the "click and drag to draw a circle" text that appears in edit mode?

ddproxy commented 6 years ago

Sorry for the late reply, you the text/tooltip is driven by CSS so you should be able to hide it completely with .leaflet-draw-tooltip { display: none;} or something similar.