Disable leaflet-draw “delete” button

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 05:34:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!