Remove the draw control from the map
Arguments
- proxy
The map proxy object created by
mapProxy().- panel_id
Optional. If provided, removes the draw control from the specified control panel. If NULL, removes the standalone draw control.
Examples
if(interactive()){
library(shiny)
library(toro)
ui <- fluidPage(
tagList(
mapOutput("map"),
actionButton("remove_draw_control", "Remove draw control")
)
)
server <- function(input, output, session) {
output$map <- renderMap({
map() |>
add_draw_control()
})
observe({
req(input$map_loaded)
mapProxy("map") |>
remove_draw_control()
}) |>
bindEvent(input$remove_draw_control)
}
}
