addProviderEspTiles: Add a tile layer from Spanish public administrations to a...

View source: R/addProviderEspTiles.R

addProviderEspTilesR Documentation

Add a tile layer from Spanish public administrations to a leaflet map

Description

Add a tile layer from Spanish public administrations to a leaflet map

Usage

addProviderEspTiles(
  map,
  provider,
  layerId = NULL,
  group = NULL,
  options = leaflet::providerTileOptions()
)

Arguments

map

the map to add the tile layer to

provider

The name of the provider. See esp_tiles_providers or https://dieghernan.github.io/leaflet-providersESP/preview/.

layerId

the layer id to assign

group

the name of the group the newly created layers should belong to (for clearGroup() and addLayersControl() purposes). Human-friendly group names are permitted–they need not be short, identifier-style names.

options

tile options

Value

modified map object

Source

https://dieghernan.github.io/leaflet-providersESP/, a plugin for leaflet, v1.3.3.

See Also

  • leaflet::leaflet().

  • leaflet::addTiles().

  • leaflet::addWMSTiles().

  • esp_tiles_providers.

Static map tiles and imagery: esp_get_attributions(), esp_get_tiles(), esp_make_provider()

Examples

library(leaflet)
leafmap <- leaflet(width = "100%", height = "60vh") |>
  setView(lat = 40.4166, lng = -3.7038400, zoom = 10) |>
  addTiles(group = "Default (OSM)") |>
  addProviderEspTiles(
    provider = "IDErioja.Claro",
    group = "IDErioja Claro"
  ) |>
  addProviderEspTiles(
    provider = "RedTransporte.Carreteras",
    group = "Carreteras"
  ) |>
  addLayersControl(
    baseGroups = c("IDErioja Claro", "Default (OSM)"),
    overlayGroups = "Carreteras",
    options = layersControlOptions(collapsed = FALSE)
  )

leafmap

mapSpain documentation built on Aug. 31, 2026, 5:07 p.m.