Open rfineman opened 6 years ago
I am afraid not. It's a two step process AFAIK. Please check with original draw authers/repo if there is a known work-around.
Here is a workaround for a Shiny-App. Include this snippet anywhere in your ui.
tags$script(HTML("
$(document).ready(function() {
function waitForElement() {
var element = document.querySelector('.leaflet-draw-edit-remove');
if (element) {
element.addEventListener('click', function() {
setTimeout(function() {
var eletoclick = $('.leaflet-draw-actions li a')[3];
if (eletoclick) {
eletoclick.click();
}
}, 100);
});
} else {
setTimeout(waitForElement, 100);
}
}
waitForElement();
});
"))
Is there a way to edit the "delete layers" button so that instead of providing the options Save|Cancel|Clear All, it merely clears all by clicking the trash can?