Package 'leaflet.providers'

Title: Leaflet Providers
Description: Contains third-party map tile provider information from 'Leaflet.js', <https://github.com/leaflet-extras/leaflet-providers>, to be used with the 'leaflet' R package. Additionally, 'leaflet.providers' enables users to retrieve up-to-date provider information between package updates.
Authors: Leslie Huang [aut], Barret Schloerke [ctb, cre] , Leaflet Providers contributors [ctb, cph] (Leaflet Providers plugin), Posit Software, PBC [cph, fnd]
Maintainer: Barret Schloerke <[email protected]>
License: BSD_2_clause + file LICENSE
Version: 2.0.0.9000
Built: 2024-11-10 05:45:31 UTC
Source: https://github.com/rstudio/leaflet.providers

Help Index


Fetch leaflet providers from Leaflet.js.

Description

Fetch leaflet providers from Leaflet.js.

Usage

get_providers(version_num = NULL)

Arguments

version_num

Version number with which to update leaflet providers. If NULL, fetches most recent version.

Value

leaflet_providers object containing providers_version_num, providers_data, providers_details_data, src

Examples

if (
  interactive() &&
  requireNamespace("V8", quietly = TRUE) &&
  requireNamespace("jsonlite", quietly = TRUE)
) {
  get_providers()
  get_providers("1.8.0")
}

Return default providers, providers_details, version, and HTML Dependency.

Description

Return default providers, providers_details, version, and HTML Dependency.

Usage

providers_default()

Value

leaflet_providers object containing providers_version_num, providers, providers_details, and src

Examples

str(providers_default(), max = 3, list.len = 4)

Return currently loaded providers, providers_details, version, and HTML Dependency.

Description

Return currently loaded providers, providers_details, version, and HTML Dependency.

Usage

providers_loaded()

Value

leaflet_providers object containing providers_version_num, providers, providers_details, and src

Examples

str(providers_loaded(), max = 3, list.len = 4)

Use custom tile provider

Description

Use a custom leaflet_providers object, e.g. providers data fetched with get_providers, with the leaflet package.

Usage

use_providers(providers_info = NULL)

Arguments

providers_info

A custom leaflet_providers object. If NULL, uses default providers.

Examples

if (require("V8") && require("jsonlite")) {
  # Set providers to latest providers
  use_providers(get_providers())

  # Set providers to a custom providers object (specific version number)
  use_providers(get_providers("1.4.0"))
  use_providers("1.4.0")
}