knitr::opts_chunk$set( collapse = TRUE, comment = "# ", eval = F )
You need a Mapbox Access Token to load a map. Then call
mapdeck(token = token) to give you a map
key <- 'abc' ## put your own token here mapdeck(token = key)
You can make your token available 'globally' to all
mapdeck() calls by either
set_token(), which sets the token as an
Sys.setenv()) with the key one of "MAPBOX_TOKEN","MAPBOX_KEY","MAPBOX_API_TOKEN", "MAPBOX_API_KEY", "MAPBOX", "MAPDECK"
Here's an example using
mapdeck(token = key, style = 'mapbox://styles/mapbox/dark-v9')
I've provided a convenience function to select one of the mapbox defined styles
mapdeck_style(style = 'dark')
Once you have a map you can start adding layers through the various
add_*() functions (there is an example of each one in this vignette).
All details about layers, colours, tips & tricks, etc, are here
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.