Disable leaflet-draw “delete” button

后端 未结 1 906
一个人的身影
一个人的身影 2021-01-24 05:36

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

1条回答
  •  温柔的废话
    2021-01-24 05:58

    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

    0 讨论(0)
提交回复
热议问题