mapboxer: Create a mapboxer widget

Description Usage Arguments Examples

View source: R/mapboxer.R

Description

Create a mapboxer widget

Usage

1
2
3
mapboxer(source = NULL, style = basemaps$Carto$dark_matter, ...,
  width = NULL, height = NULL, element_id = NULL,
  token = Sys.getenv("MAPBOX_API_TOKEN"))

Arguments

source

A mapbox_source that is added to the map with the ID MAPBOXER.

style

The map's Mapbox style.

...

The properties of the map, see https://docs.mapbox.com/mapbox-gl-js/api/map/.

width

The width of the widget.

height

The height of the widget.

element_id

The unique ID of the widget.

token

A Mapbox API access token. Only needed if you want to use styles from Mapbox.

Examples

1
2
3
4
5
6
7
8
9
map <- mapboxer(
  center = c(-73.9165, 40.7114),
  zoom = 10,
  minZoom = 6,
  pitch = 30,
  bearing = 45
)

if (interactive()) map

Example output



mapboxer documentation built on Nov. 8, 2020, 4:21 p.m.