Skip to contents

Include tiles of public Spanish organisms to a leaflet::leaflet() map.

Usage

addProviderEspTiles(
  map,
  provider,
  layerId = NULL,
  group = NULL,
  options = providerEspTileOptions()
)

providerEspTileOptions(...)

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 and addLayersControl 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().

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