0

I know there's a way for disabling just the “delete” button in leaflet-draw's edit toolbar.

I'm wondering if there is a complementary setting, i.e.: disabling the edit button but keeping active the delete button (the one with the trash bin icon).

Besides, I'd like to know if there is an easy way for customizing the "delete" button options. I need to disable the "Save" options that you see once you have clicked on the delete icon.

floatingpurr
  • 7,749
  • 9
  • 46
  • 106
  • 1
    Have you tried https://stackoverflow.com/a/40419084/4768502 but replacing `remove` with `edit`? See also https://github.com/Leaflet/Leaflet.draw/blob/6bc037bc0c160ac9338bc7e62153dbe33fea6fa3/src/Leaflet.draw.js#L169 – IvanSanchez Apr 05 '18 at 13:21
  • @IvanSanchez excuse me if I take advantage of this post, I updated my question a little bit. :) – floatingpurr Apr 05 '18 at 16:49

1 Answers1

5

Are you looking for this ?

edit: {
      featureGroup: drawnItem,
      edit: false
    }

CSS

.leaflet-draw-actions {
  display: none !important;
}

Or this ?

L.Draw.Toolbar.include({
    save: false,
    cancel: false
});

new L.Control.Draw({
    edit: {
        edit: false,
        featureGroup: drawnItems
    }
}).addTo(map);
Dostonbek Oripjonov
  • 1,508
  • 1
  • 12
  • 28
  • 1
    I wanted to have only delete option on Edit Toolbar and this solved my scenario. edit: { featureGroup: drawnItem, edit: false } – Saad Khan Feb 05 '20 at 13:23