mapdeck

mapdeck(
  data = NULL,
  token = get_access_token(api = "mapbox"),
  width = NULL,
  height = NULL,
  padding = 0,
  style = "mapbox://styles/mapbox/streets-v9",
  pitch = 0,
  zoom = 0,
  bearing = 0,
  max_zoom = 20,
  min_zoom = 0,
  max_pitch = 60,
  min_pitch = 0,
  location = c(0, 0),
  show_view_state = FALSE,
  repeat_view = FALSE
)

Arguments

data

data to be used in the layer. All coordinates are expected to be EPSG:4326 (WGS 84) coordinate system

token

Mapbox Acess token. Use set_token() or Sys.setenv() to set a global token. See Access Tokens section for further details. If left empty layers will still be plotted, but without a Mapbox map.

width

the width of the map

height

the height of the map

padding

the padding of the map

style

the style of the map (see mapdeck_style)

pitch

the pitch angle of the map

zoom

zoom level of the map

bearing

bearing of the map between 0 and 360

max_zoom

sets the maximum zoom level

min_zoom

sets the minimum zoom level

max_pitch

sets the maximum pitch

min_pitch

sets the minimum pitch

location

unnamed vector of lon and lat coordinates (in that order)

show_view_state

logical, indicating whether to add the current View State to the map. When TRUE, the following is added as an overlay to the map

  • width

  • height

  • latitude & longitude

  • zoom

  • bearing

  • pitch

  • altitude

  • viewBounds

  • interactionState

repeat_view

Logical indicating if the layers should repeat at low zoom levels

Access Tokens

If the token argument is not used, the map will search for the token, firstly by checking if set_token() was used, then it will search environment variables using Sys.getenv() and the following values, in this order

c("MAPBOX_TOKEN","MAPBOX_KEY","MAPBOX_API_TOKEN", "MAPBOX_API_KEY", "MAPBOX", "MAPDECK")

If multiple tokens are found, the first one is used