R/glify-remove-clear.R

Defines functions clearGlLayers removeGlPolygons removeGlPolylines removeGlPoints

Documented in clearGlLayers removeGlPoints removeGlPolygons removeGlPolylines

#' removeGlPoints
#' @description Remove points from a map, identified by layerId;
#' @param map The map widget
#' @param layerId The layerId to remove
#' @export
removeGlPoints <- function(map, layerId) {
  leaflet::invokeMethod(map, NULL, "removeGlPoints", layerId)
}

#' removeGlPolylines
#' @description Remove lines from a map, identified by layerId;
#' @param map The map widget
#' @param layerId The layerId to remove
#' @export
removeGlPolylines <- function(map, layerId) {
  leaflet::invokeMethod(map, NULL, "removeGlPolylines", layerId)
}

#' removeGlPolygons
#' @description Remove polygons from a map, identified by layerId;
#' @param map The map widget
#' @param layerId The layerId to remove
#' @export
removeGlPolygons <- function(map, layerId) {
  leaflet::invokeMethod(map, NULL, "removeGlPolygons", layerId)
}

#' clearGlLayers
#' @description Clear all Glify features
#' @param map The map widget
#' @export
clearGlLayers <- function(map) {
  leaflet::invokeMethod(map, NULL, "clearGlLayers")
}

Try the leafgl package in your browser

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

leafgl documentation built on July 2, 2020, 4:02 a.m.