How can I disable/remove the delete button in the leaflet-draw edit toolbar? The "edit" button should remain enabled.
Asked
Active
Viewed 4,800 times
2 Answers
6
Regarding to the docs in chapter Disabeling a Toolbar Item you can do the following:
map.addControl(new L.Control.Draw({
edit: {
featureGroup: drawnItems,
remove: false
}
}));
This adds a new Control bar without the delete Button, but the edit button will remain

Manuel
- 2,334
- 4
- 20
- 36
0
<EditControl
position="topright"
edit={{
remove: false,
edit: false
}}
/>

keikai
- 14,085
- 9
- 49
- 68

Mert Kahramantürk
- 123
- 7
-
if you want the edit button active, you can remove the edit:false part – Mert Kahramantürk Feb 24 '22 at 11:10