I'm trying to set the default for leaflet as the select all option and when nothing is selected it should display all the values as in select all.
So with the following code, select all works fine as well as selecting individual options. But when I select the Deselect all option, the current chosen values still stay. And with the ignoreNULL = FALSE, I'll get an empty leaflet which is not my requirement. How do I tweak this?
observeEvent(input$Selector, {
proxy <- leafletProxy("myMap") %>%
clearGroup("myMarkers")
if(!is.null(input$Selector)){
proxy %>%
addCircleMarkers(
data = filter_data(),
~filter_data()$Long,
~filter_data()$Lat,
radius = filter_data()$Diameter,
group = "myMarkers",
)
}
}, ignoreNULL = TRUE)