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)

Arguments

api

character string denoting which service ("mapbox" only)

...

currently ignored

silent

run in completely silent mode, default is to provide a warning

Value

The stored API key value, see Details.

Details

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.

Examples

get_api_key()
#> Warning: no mapbox key found
#> 
#> 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
#> 
#> See 'help(ceramic::get_api_key)'
#> NULL