View source: R/provider-mapbox.R
get_api_key | R Documentation |
Mapbox tile providers require an API key. Other providers may not need a key and so this is ignored.
get_api_key(api = "mapbox", ..., silent = FALSE)
api |
character string denoting which service ("mapbox" only) |
... |
currently ignored |
silent |
run in completely silent mode, default is to provide a warning |
The mapdeck package has a more comprehensive tool for setting the Mapbox API key, if this is in use ceramic will find it first and use it.
To set your Mapbox API key obtain a key from https://account.mapbox.com/access-tokens/
1) Run this to set for the session 'Sys.setenv(MAPBOX_API_KEY=<yourkey>)' OR, 2) To set permanently store 'MAPBOX_API_KEY=<yourkey>' in '~/.Renviron'.
There is a fairly liberal allowance for the actual name of the environment variable, any of 'MAPBOX_API_KEY', 'MAPBOX_API_TOKEN', 'MAPBOX_KEY', 'MAPBOX_TOKEN', or 'MAPBOX' will work (and they are sought in that order).
If no key is available, NULL
is returned, with a warning.
The stored API key value, see Details.
get_api_key()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.