Description Usage Arguments Examples
Uses the Mapbox GL Leaflet plugin to add a Mapbox GL layer to a Leaflet map.
1 2 3 4 5 | mapboxOptions(accessToken = NULL, ...)
addMapboxGL(map, style = "mapbox://styles/mapbox/streets-v9",
accessToken = getOption("mapbox.accessToken"), layerId = NULL,
group = NULL, setView = TRUE, options = mapboxOptions())
|
accessToken |
A Mapbox access token,
or |
... |
Other options to pass to Mapbox GL JS. |
map |
The Leaflet R object (see |
style |
Tile vector URL; can begin with |
layerId |
A layer ID; see docs. |
group |
The name of the group the newly created layer should belong to
(for |
setView |
If |
options |
A list of Map options. See the Mapbox GL JS documentation for more details. Not all options may work in the context of Leaflet. |
1 2 3 4 5 6 7 8 | # Before running, set your Mapbox access token using:
# `options(mapbox.accessToken = "...")`
library(leaflet)
leaflet(quakes) %>%
addMapboxGL(style = "mapbox://styles/mapbox/streets-v9") %>%
addCircleMarkers(weight = 1, fillOpacity = 0, radius = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.