Skip to contents

Configures an API key for tile providers such as "carto" (CartoDB), "maptiler", "stadia", "thunderforest", "jawg", "mapbox", or "esri". Once set, all subsequent calls to glmap(), set_basemap(), and add_provider_tiles() automatically inject the key into the provider's style URL and tile URLs.

Usage

gl_set_api_key(provider, api_key = NULL)

gl_get_api_key(provider)

Arguments

provider

Provider family name (e.g., "carto", "maptiler", "stadia", "thunderforest", "jawg", "mapbox", "esri"), or a named list of keys.

api_key

API key string (or NULL to clear).

Value

Invisibly returns the stored key(s).