R/leaf_clear.R

Defines functions leaf_clear

Documented in leaf_clear

#' @title In shiny, clear all features, images and legends.
#' @description In shiny, clear all features, images and legends.
#'
#' @param map_id The map id for a leaflet map. Defaults to "leaf".
#'
#' @return A map object.
#' @export
leaf_clear <- function(map_id = "leaf") {
  leafletProxy(map_id) %>%
    clearMarkers() %>%
    clearShapes() %>%
    clearImages() %>% 
    clearControls()
}

Try the simplevis package in your browser

Any scripts or data that you put into this service are public.

simplevis documentation built on May 31, 2023, 7:02 p.m.