Open vmagalhaes opened 7 years ago
Have you tried modifying L.drawLocal
actions to remove the values from the edit: toolbar: ?
https://github.com/Leaflet/Leaflet.draw/blob/a539be549ccca50ea7039d698f783d13f7a0a7b5/src/Leaflet.draw.js#L154
@ddproxy yeh, but it breaks when I click on edit button
Did you find a way to remove the actions ? I need this too.
Did you find a way to remove the actions ? I need this too.
Unfortunately no, I tried, but I doesn't work.
@vmagalhaes @dmizrahi here is what I did to remove the buttons it unfortunately is not perfect since there is no way to remove the parent "li" element. I dug through the source code for a bit to find the logic for button creation and looks like there is no option to disable. Hope this semi functioning solution helps hold you over until a proper fix is put in place.
I first edited the title of the ones I wanted to hide with a custom title "my-custom-leaflet-hide".
L.drawLocal.draw.toolbar.finish.title = 'my-custom-leaflet-hide'; L.drawLocal.draw.toolbar.actions.text = 'New Cancel Name // I want to keep this one. L.drawLocal.draw.toolbar.undo.title = 'my-custom-leaflet-hide'; // Add the controls to my map new L.Control.Draw(options).addTo(myMap);
Once I did this I added this line to my CSS as the buttons are anchor tags. I referenced the title attribute to hide the elements.
a[title="my-custom-leaflet-hide"] { display: none !important; }
Hi,
I need remove this buttons when I click at polyline or polygon.
Have a way to remove this?
Thanks