R/examples_does-it-work.R

Defines functions does_it_work

Documented in does_it_work

#' Check if everything works fine
#'
#' @inheritParams add_mapbox_basemap
#'
#' @export
does_it_work <- function(token = NULL) {
  it_works <- data.frame(lat = 37.8, lng = -122.45, text = "it works")
  deck <- deckgl() %>%
    add_text_layer(data = it_works, getPosition = JS("data => [data.lng, data.lat]"))
  if (is.null(token)) {
    return(deck)
  }

  deck %>%
    add_mapbox_basemap(token = token)
}

Try the deckgl package in your browser

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

deckgl documentation built on July 1, 2020, 7:36 p.m.