1

How can I disable/remove the delete button in the leaflet-draw edit toolbar? The "edit" button should remain enabled.

Attila Fulop
  • 6,861
  • 2
  • 44
  • 50
codejunkie
  • 908
  • 2
  • 21
  • 34

2 Answers2

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