R/controls.R

Defines functions add_control

Documented in add_control

#' Add a control to the widget
#' @inheritParams add_layer
#' @param html The \code{innerHTML} of the element.
#' @param pos The position of the control. Possible values are \code{top-left}, \code{top-right},
#' \code{bottom-right} and \code{bottom-left}.
#' @param style A \code{cssText} string that will modefiy the default style of the element.
#' @examples
#' deck <- deckgl() %>%
#'   add_basemap() %>%
#'   add_control(
#'     "<h1>Blank Base Map</h1>",
#'     pos = "top-right",
#'     style = "background: #004080; color: white;"
#'   )
#'
#' if (interactive()) deck
#' @export
add_control <- function(deckgl, html, pos = "top-right", style = NULL) {
  invoke_method(deckgl, "addControl", html = html, pos = pos, style = style)
}

Try the deckgl package in your browser

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

deckgl documentation built on March 7, 2023, 5:37 p.m.