Disable leaflet-draw “delete” button

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

Answers:

Answer

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

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.