Search code examples
leafletleaflet.draw

How to remove save option from leaflet draw api delete button?


My question is similar to leaflet-draw delete button remove "clear all" action but I want to remove save option instead of clear all.


Solution

  • Well, there are no customization provided by draw api to do that. So I have added a custom css to hide it.

    Apart from that, we can also customized the plugin as follows : To change the text : L.drawLocal.edit.toolbar.actions.clearAll.text = t('Clear');

    To overwrite the clear method :

    L.EditToolbar.Delete.prototype._enableLayerDelete = function(t) {
                    me.drawToolbar = this;
                    (t.layer || t.target || t).on("click", me.clearAllCustom, this)
            };