简体   繁体   中英

How do I bind an event listener to Clear All button in the edit toolbar?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM