The goal of leaflet.providers is to provide regularly updated data on
the third-party tile providers supported by leaflet. The data is
extracted from
leaflet-providers.js.
While leaflet.providers will be regularly released with updated
providers data, the package comes with functions use_providers() and
get_providers(), which enable users to fetch up-to-date providers
information directly from
leaflet-providers.js
between package updates and to load this providers data in leaflet.
Users may also fetch older versions of the providers data with the
leaflet-providers.js version number.
Installation
You can install the released version of leaflet.providers from
CRAN:
# CRAN version
install.packages("leaflet.providers")
The following are basic example of the default providers data that comes
leaflet.providers as well as the available methods to fetch and load
custom providers.
Usage
In general, you do not need to load or interact with leaflet.providers
directly. Instead, leaflet.providers is used indirectly by the
leaflet package in the
leaflet::addProviderTiles() function.
You can choose a specific version of leaflet-providers.js by calling
use_providers() with the desired version or the providers from a
desired version:
# Shorthand method:
use_providers("1.7.0")
# Longer method:
# 1. Retrieve v 1.7.0
providers_170 <- get_providers("1.7.0")
# 2. Load custom providers data
use_providers(providers_170)
# Reset loaded providers to default providers
use_providers()
Now that use_providers() has been called with a custom
leaflet.providers object obtained via get_providers() (in this case,
a previous version of the data),
leaflet will use the custom
providers instead of the default provider data.
Note that the package V8 is required for get_providers().
leaflet.providers
The goal of
leaflet.providersis to provide regularly updated data on the third-party tile providers supported byleaflet. The data is extracted from leaflet-providers.js.While
leaflet.providerswill be regularly released with updated providers data, the package comes with functionsuse_providers()andget_providers(), which enable users to fetch up-to-date providers information directly from leaflet-providers.js between package updates and to load this providers data inleaflet. Users may also fetch older versions of the providers data with theleaflet-providers.jsversion number.Installation
You can install the released version of
leaflet.providersfrom CRAN:And the development version from GitHub with:
Example
The following are basic example of the default providers data that comes
leaflet.providersas well as the available methods to fetch and load custom providers.Usage
In general, you do not need to load or interact with
leaflet.providersdirectly. Instead,leaflet.providersis used indirectly by the leaflet package in theleaflet::addProviderTiles()function.Fetch custom providers
You can choose a specific version of
leaflet-providers.jsby callinguse_providers()with the desired version or the providers from a desired version:Now that
use_providers()has been called with a customleaflet.providersobject obtained viaget_providers()(in this case, a previous version of the data),leafletwill use the custom providers instead of the default provider data.Default providers
View the loaded providers data
The version number of the source leaflet-providers.js
Supported tile providers
Tile providers’ details
Developer
Updating to a new leaflet-providers version
To update this package to a new upstream release of leaflet-providers.js, run the following Claude Code skill:
This walks through the full update workflow: fetching the new JS, regenerating package data, bumping the version, running checks, and creating a PR.