0

Leaflet-draw allows users to create a draw control that comes with an edit and delete button for the layers.

For the delete button, there are three sub-buttons: Save, Cancel and Clear All. I want to bind my custom event to the Clear All button. I went through the documentation for Leaflet and could not find anything about binding events to draw controls buttons.

map.on('click:clearall', function () {
    //do something
})

Clear All is supposed to fire an event that allows me to delete dynamic elements associated with the created layers. Instead, the dynamic elements remained while the layers are deleted.

disguisedtoast
  • 149
  • 1
  • 4
  • 15