R/selection.R

Defines functions removeSelect addSelect locationFilter2Dependencies

locationFilter2Dependencies <- function() {
  list(
    htmltools::htmlDependency(
      "leaflet-locationfilter2",
      "0.1.1",
      "htmlwidgets/plugins/leaflet-locationfilter",
      package = "leaflet",
      script = c("locationfilter.js", "locationfilter-bindings.js"),
      stylesheet = c("locationfilter.css")
    )
  )
}

addSelect <- function(map, data = getMapData(map)) {
  map$dependencies <- c(map$dependencies,
    leafletEasyButtonDependencies(),
    locationFilter2Dependencies())
  map <- addIonIcon(map)

  invokeMethod(map, data, "addSelect",
    getCrosstalkOptions(data)[["ctGroup"]]
  )
}

removeSelect <- function(map) {
  invokeMethod(map, NULL, "removeSelect")
}

Try the leaflet package in your browser

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

leaflet documentation built on March 24, 2022, 1:05 a.m.