leaflet.draw trash button delete all polygons and save
问题 Using javascript, how can I alter the leaflet.draw "Trash" button to delete all polygons that have been drawn and automatically save. Below is the code I've implemented but it is a complete hack. It removes the active polygon, but after I delete an object once I begin to get errors in the console when I click the "Trash" icon like NotFoundError: Node was not found and TypeError: this._deletedLayers is null map.on('draw:editstart', function (e) { if(e.handler == 'remove' && typeof drawnItem !=