Learn R Programming

tmap (version 4.4)

.tmap_providers: Get basemap tile providers

Description

Get basemap tile providers and their credits (attribution text). tmap_providers() returns a list or vector of provider names or credits. tmap_provider_credits() returns the attribution text for a specific provider.

Usage

.tmap_providers

tmap_provider_credits(provider)

tmap_providers(mode, credits = FALSE, as.list = credits)

Value

tmap_providers() returns a list or vector (see as.list) of provider names or credits. tmap_provider_credits() returns the attribution text for the specified provider. .tmap_providers is an environment; see Details.

Arguments

provider

provider name

mode

mode. If not specified the current active mode is used.

credits

If TRUE the credit (attribution) text is returned. If FALSE (default) the provider name.

as.list

Should the output be returned as a list where names are provider names? By default TRUE when credits is also TRUE.

Details

.tmap_providers is an environment populated with all available provider names as named entries. Its primary purpose is to enable autocomplete in IDEs such as RStudio: typing .tmap_providers$ in the console or a script triggers a dropdown list of all available providers, making it easy to discover and select provider names without consulting the documentation. It is not intended to be called as a function.

Examples

Run this code
# List all providers for the current mode
tmap_providers()

# Use IDE autocomplete to discover providers interactively:
# type .tmap_providers$ in the RStudio console

Run the code above in your browser using DataLab