问题
How can I disable/remove the delete button in the leaflet-draw edit toolbar? The "edit" button should remain enabled.
回答1:
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
来源:https://stackoverflow.com/questions/40414970/disable-leaflet-draw-delete-button