Include base tiles of Spanish public administrations on a leaflet map
Source:R/addProviderEspTiles.R
addProviderEspTiles.Rd
Include tiles of public Spanish organisms to a leaflet::leaflet()
map.
Usage
addProviderEspTiles(
map,
provider,
layerId = NULL,
group = NULL,
options = providerEspTileOptions()
)
providerEspTileOptions(...)
Source
https://dieghernan.github.io/leaflet-providersESP/ leaflet plugin, v1.3.3.
Arguments
- map
the map to add the tile layer to
- provider
Name of the provider, see esp_tiles_providers for values available.
- layerId
the layer id to assign
- group
the name of the group the newly created layers should belong to (for
clearGroup
andaddLayersControl
purposes). Human-friendly group names are permitted–they need not be short, identifier-style names.- options
tile options
- ...
Arguments passed on to
leaflet::providerTileOptions()
.
Value
A modified leaflet::leaflet()
map
object.
Details
providerEspTileOptions()
is a wrapper of leaflet::providerTileOptions()
.
See also
leaflet::leaflet()
, leaflet::addTiles()
leaflet::providerTileOptions()
, leaflet::tileOptions()
Other imagery utilities:
esp_getTiles()
,
esp_make_provider()
,
esp_tiles_providers
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