From bd06d74f241f3067c654c261644da2c54d87844f Mon Sep 17 00:00:00 2001 From: Diego H Date: Thu, 27 Oct 2022 11:28:07 +0000 Subject: [PATCH] Update providers --- CITATION.cff | 27 +- DESCRIPTION | 2 +- NEWS.md | 6 + R/addProviderEspTiles.R | 2 +- R/data.R | 4 +- R/esp_cache.R | 3 - R/esp_getTiles.R | 5 +- R/esp_get_grid_BDN.R | 3 - R/esp_get_grid_EEA.R | 2 - R/esp_get_grid_ESDAC.R | 1 - R/utils_tiles.R | 2 - README.Rmd | 3 +- codemeta.json | 4 +- data-raw/input/leaflet-providers.js | 1516 +++++++--------------- data-raw/input/leafletproviders-ESP.html | 32 +- data-raw/input/leafletproviders-ESP.xlsx | Bin 27454 -> 45578 bytes data-raw/input/leafletproviders.html | 2 +- data-raw/leaflet.providersESP.df.R | 15 + data/esp_codelist.rda | Bin 4308 -> 3760 bytes data/leaflet.providersESP.df.rda | Bin 4834 -> 4240 bytes img/README-static-1.png | Bin 277090 -> 276077 bytes inst/WORDLIST | 2 +- man/addProviderEspTiles.Rd | 2 +- man/esp_getTiles.Rd | 4 +- man/leaflet.providersESP.df.Rd | 4 +- tests/testthat/test-esp_cache.R | 1 - tests/testthat/test-esp_dict.R | 15 +- tests/testthat/test-layer_spatraster.R | 1 - vignettes/basic-1.png | Bin 46077 -> 33775 bytes vignettes/basic-2.png | Bin 53435 -> 39839 bytes vignettes/basic-3.png | Bin 132740 -> 121553 bytes vignettes/choro-1.png | Bin 82302 -> 58309 bytes vignettes/giscoR-1.png | Bin 137145 -> 136116 bytes vignettes/mapSpain.Rmd | 14 +- vignettes/thematic-1.png | Bin 201789 -> 38014 bytes 35 files changed, 554 insertions(+), 1118 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index f8fa3e16..42ee37fd 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,5 @@ # ----------------------------------------------------------- -# CITATION file created with {cffr} R package, v0.2.2 +# CITATION file created with {cffr} R package, v0.3.0 # See also: https://docs.ropensci.org/cffr/ # ----------------------------------------------------------- @@ -8,7 +8,7 @@ message: 'To cite package "mapSpain" in publications use:' type: software license: GPL-3.0-only title: 'mapSpain: Administrative Boundaries of Spain' -version: 0.6.2 +version: 0.6.2.9000 doi: 10.5281/zenodo.5366622 abstract: Administrative Boundaries of Spain at several levels (Autonomous Communities, Provinces, Municipalities) based on the 'GISCO' 'Eurostat' database @@ -31,7 +31,7 @@ preferred-citation: orcid: https://orcid.org/0000-0001-8457-4658 affiliation: rOpenSpain year: '2022' - version: 0.6.2 + version: 0.6.2.9000 doi: 10.5281/zenodo.5366622 url: https://ropenspain.github.io/mapSpain/ abstract: Administrative Boundaries of Spain at several levels (Autonomous Communities, @@ -92,7 +92,7 @@ references: email: vincent.arel-bundock@umontreal.ca orcid: https://orcid.org/0000-0003-2042-7063 year: '2022' - url: https://CRAN.R-project.org/package=countrycode + url: https://vincentarelbundock.github.io/countrycode/ version: '>= 1.2.0' - type: software title: giscoR @@ -105,7 +105,6 @@ references: orcid: https://orcid.org/0000-0001-8457-4658 affiliation: rOpenGov year: '2022' - url: https://CRAN.R-project.org/package=giscoR version: '>= 0.2.4' - type: software title: rappdirs @@ -120,7 +119,6 @@ references: - family-names: Davis given-names: Trevor year: '2022' - url: https://CRAN.R-project.org/package=rappdirs version: '>= 0.3.0' - type: software title: sf @@ -132,7 +130,6 @@ references: email: edzer.pebesma@uni-muenster.de orcid: https://orcid.org/0000-0001-8049-7069 year: '2022' - url: https://CRAN.R-project.org/package=sf version: '>= 0.9.0' - type: software title: utils @@ -179,7 +176,6 @@ references: given-names: Dewey orcid: https://orcid.org/0000-0002-9415-4582 year: '2022' - url: https://CRAN.R-project.org/package=ggplot2 version: '>= 3.0.0' - type: software title: knitr @@ -191,7 +187,7 @@ references: email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 year: '2022' - url: https://CRAN.R-project.org/package=knitr + url: https://yihui.org/knitr/ - type: software title: leaflet abstract: 'leaflet: Create Interactive Web Maps with the JavaScript ''Leaflet'' @@ -206,7 +202,7 @@ references: - family-names: Xie given-names: Yihui year: '2022' - url: https://CRAN.R-project.org/package=leaflet + url: https://rstudio.github.io/leaflet/ version: '>= 2.0.0' - type: software title: png @@ -217,7 +213,7 @@ references: given-names: Simon email: Simon.Urbanek@r-project.org year: '2022' - url: https://CRAN.R-project.org/package=png + url: http://www.rforge.net/png/ version: '>= 0.1-5' - type: software title: rmarkdown @@ -257,7 +253,6 @@ references: email: rich@rstudio.com orcid: https://orcid.org/0000-0003-3925-190X year: '2022' - url: https://CRAN.R-project.org/package=rmarkdown - type: software title: slippymath abstract: 'slippymath: Slippy Map Tile Tools' @@ -271,7 +266,7 @@ references: given-names: Michael email: mdsumner@gmail.com year: '2022' - url: https://CRAN.R-project.org/package=slippymath + url: https://www.github.com/milesmcbain/slippymath version: '>= 0.3.1' - type: software title: terra @@ -283,7 +278,7 @@ references: email: r.hijmans@gmail.com orcid: https://orcid.org/0000-0001-5872-2872 year: '2022' - url: https://CRAN.R-project.org/package=terra + url: https://rspatial.org/terra/ version: '>= 1.1-4' - type: software title: testthat @@ -294,11 +289,10 @@ references: given-names: Hadley email: hadley@rstudio.com year: '2022' - url: https://CRAN.R-project.org/package=testthat version: '>= 3.0.0' - type: software title: tidyterra - abstract: 'tidyterra: ''tidyverse'' Methods and ''ggplot2'' Utils for ''terra'' + abstract: 'tidyterra: ''tidyverse'' Methods and ''ggplot2'' Helpers for ''terra'' Objects' notes: Suggests authors: @@ -307,4 +301,3 @@ references: email: diego.hernangomezherrero@gmail.com orcid: https://orcid.org/0000-0001-8457-4658 year: '2022' - url: https://CRAN.R-project.org/package=tidyterra diff --git a/DESCRIPTION b/DESCRIPTION index 641bf967..debbb43e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: mapSpain Title: Administrative Boundaries of Spain -Version: 0.6.2 +Version: 0.6.2.9000 Authors@R: person("Diego", "Hernangómez", , "diego.hernangomezherrero@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0001-8457-4658", affiliation = "rOpenSpain")) diff --git a/NEWS.md b/NEWS.md index d76d68ec..7bc9b15d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# mapSpain (development version) + +- Upgrade `leaflet.providersESP.df` to + v1.3.1. Fix + `"MDT"/"MDT.Relieve"` provider. + # mapSpain 0.6.2 - Now `moveCAN` is a explicit parameter in the relevant functions. diff --git a/R/addProviderEspTiles.R b/R/addProviderEspTiles.R index ac12475f..069d906e 100644 --- a/R/addProviderEspTiles.R +++ b/R/addProviderEspTiles.R @@ -12,7 +12,7 @@ #' #' @source #' leaflet plugin, -#' **v1.3.0**. +#' **v1.3.1**. #' #' @return A map object generated with [leaflet::leaflet()]. #' diff --git a/R/data.R b/R/data.R index ceb43577..66f23f29 100644 --- a/R/data.R +++ b/R/data.R @@ -171,13 +171,13 @@ NULL #' #' This function is a implementation of the javascript plugin #' [leaflet-providersESP](https://dieghernan.github.io/leaflet-providersESP/) -#' **v1.3.0**. +#' **v1.3.1**. #' #' @docType data #' #' @source #' leaflet plugin, -#' **v1.3.0**. +#' **v1.3.1**. #' #' @encoding UTF-8 #' diff --git a/R/esp_cache.R b/R/esp_cache.R index 84991477..6711c2b0 100644 --- a/R/esp_cache.R +++ b/R/esp_cache.R @@ -43,8 +43,6 @@ esp_set_cache_dir <- function(cache_dir, overwrite = FALSE, install = FALSE, verbose = TRUE) { - - # Default if not provided if (missing(cache_dir) || cache_dir == "") { if (verbose) { @@ -147,7 +145,6 @@ esp_clear_cache <- function(config = TRUE, #' #' @noRd esp_hlp_detect_cache_dir <- function() { - # Try from getenv getvar <- Sys.getenv("MAPSPAIN_CACHE_DIR") diff --git a/R/esp_getTiles.R b/R/esp_getTiles.R index 4b776f00..80d449f2 100644 --- a/R/esp_getTiles.R +++ b/R/esp_getTiles.R @@ -6,7 +6,7 @@ #' #' This function is a implementation of the javascript plugin #' [leaflet-providersESP](https://dieghernan.github.io/leaflet-providersESP/) -#' **v1.3.0**. +#' **v1.3.1**. #' #' @family imagery utilities #' @seealso [terra::rast()]. @@ -17,7 +17,7 @@ #' . #' @source #' leaflet plugin, -#' **v1.3.0**. +#' **v1.3.1**. #' #' @export #' @@ -232,7 +232,6 @@ esp_getTiles <- function(x, # reproject rout if needed if (!sf::st_crs(x) == sf::st_crs(rout)) { - # Sometimes it gets an error rout_end <- try(terra::project( diff --git a/R/esp_get_grid_BDN.R b/R/esp_get_grid_BDN.R index 30c53b82..3791f93d 100644 --- a/R/esp_get_grid_BDN.R +++ b/R/esp_get_grid_BDN.R @@ -45,7 +45,6 @@ esp_get_grid_BDN <- function(resolution = 10, update_cache = FALSE, cache_dir = NULL, verbose = FALSE) { - # Check grid res <- as.numeric(resolution) @@ -101,8 +100,6 @@ esp_get_grid_BDN_ccaa <- function(ccaa, update_cache = FALSE, cache_dir = NULL, verbose = FALSE) { - - # Get region id ccaa <- ccaa[!is.na(ccaa)] diff --git a/R/esp_get_grid_EEA.R b/R/esp_get_grid_EEA.R index 72cf7f2b..eb380ec3 100644 --- a/R/esp_get_grid_EEA.R +++ b/R/esp_get_grid_EEA.R @@ -39,8 +39,6 @@ esp_get_grid_EEA <- function(resolution = 100, update_cache = FALSE, cache_dir = NULL, verbose = FALSE) { - - # Check grid res <- as.numeric(resolution) diff --git a/R/esp_get_grid_ESDAC.R b/R/esp_get_grid_ESDAC.R index 2fa271d0..53b93b37 100644 --- a/R/esp_get_grid_ESDAC.R +++ b/R/esp_get_grid_ESDAC.R @@ -44,7 +44,6 @@ esp_get_grid_ESDAC <- function(resolution = 10, update_cache = FALSE, cache_dir = NULL, verbose = FALSE) { - # Check grid res <- as.numeric(resolution) diff --git a/R/utils_tiles.R b/R/utils_tiles.R index d80f6d49..bb7c9f12 100644 --- a/R/utils_tiles.R +++ b/R/utils_tiles.R @@ -17,7 +17,6 @@ getwms <- function(x, res, transparent, options) { - # Get squared bbox bbox <- as.double(sf::st_bbox(x)) dimx <- (bbox[3] - bbox[1]) @@ -229,7 +228,6 @@ getwmts <- function(x, #' @name compose_tile_grid #' @noRd compose_tile_grid <- function(tile_grid, ext, images, transparent) { - # Based on https://github.com/riatelab/maptiles/blob/main/R/get_tiles.R bricks <- vector("list", nrow(tile_grid$tiles)) diff --git a/README.Rmd b/README.Rmd index 2c25f291..ec605ec9 100644 --- a/README.Rmd +++ b/README.Rmd @@ -164,8 +164,7 @@ shape_pop <- merge(shape, tile <- esp_getTiles(shape_pop, type = "IGNBase.Todo", - zoom = 10, - bbox_expand = .1 + zoommin = 1 ) # Plot diff --git a/codemeta.json b/codemeta.json index 97331822..dd3f942d 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/rOpenSpain/mapSpain", "issueTracker": "https://github.com/rOpenSpain/mapSpain/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.6.2", + "version": "0.6.2.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -233,7 +233,7 @@ "applicationCategory": "cartography", "isPartOf": "https://ropenspain.es/", "keywords": ["rOpenSpain", "tiles", "r", "maps", "spatial", "rstats", "r-package", "municipalities", "Spain", "gisco", "provinces", "ign", "administrative-boundaries", "ccaa", "static-tiles", "spain", "cran", "ropenspain", "ggplot2", "gis"], - "fileSize": "2849.304KB", + "fileSize": "2622.307KB", "citation": [ { "@type": "SoftwareSourceCode", diff --git a/data-raw/input/leaflet-providers.js b/data-raw/input/leaflet-providers.js index e905edb9..cb8e8a15 100644 --- a/data-raw/input/leaflet-providers.js +++ b/data-raw/input/leaflet-providers.js @@ -1,1042 +1,476 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['leaflet'], factory); - } else if (typeof modules === 'object' && module.exports) { - // define a Common JS module that relies on 'leaflet' - module.exports = factory(require('leaflet')); - } else { - // Assume Leaflet is loaded into global object L already - factory(L); - } -}(this, function (L) { - 'use strict'; +// leaflet-providersESP.js plugin v1.3.1 +// (c) D. Hernangomez - MIT License +// https://dieghernan.github.io/leaflet-providersESP/ +// Issues: https://dieghernan.github.io/leaflet-providersESP/issues +// All providers are open source. Please check attributions +// Feel free to contribute +"use strict"; +var providersESPversion = 'v1.3.1'; +// Databases +// WMTS Servers - Tile Maps - Mapas de Teselas +var completeWMTS = "&style=default&tilematrixset=GoogleMapsCompatible&TileMatrix={z}&TileRow={y}&TileCol={x}"; +var providersESP = { + IDErioja: { + url: "https://rts.larioja.org/wmts/mapa_base_rioja?service=WMTS&request=GetTile&version=1.0.0&Format=image/png&layer=mapa_base_rioja" + completeWMTS, + options: { + attribution: "CC BY 4.0 www.iderioja.org" + } + }, + // IGN Mapa Base + IGNBase: { + url: "https://www.ign.es/wmts/ign-base?service=WMTS&request=GetTile&version=1.0.0&Format=image/{ext}&layer={variant}" + completeWMTS, + options: { + attribution: "CC BY 4.0 scne.es. Sistema Geográfico Nacional IGN ", + variant: "IGNBaseTodo", + ext: "png" + }, + variants: { + Todo: "IGNBaseTodo", + Gris: { + options: { + variant: "IGNBase-gris", + ext: "jpeg" + } + }, + TodoNoFondo: { + options: { + variant: "IGNBaseTodo-nofondo", + bounds: [ + [27, -19], + [44, 5] + ], + minZoom: 4 + } + }, + Orto: { + options: { + variant: "IGNBaseOrto", + bounds: [ + [27, -19], + [44, 5] + ], + minZoom: 5 + } + } + } + }, + // MDT + MDT: { + url: "https://servicios.idee.es/wmts/mdt?service=WMTS&request=GetTile&version=1.0.0&Format=image/png&layer={variant}" + completeWMTS, + options: { + attribution: "Infraestructura de Datos Espaciales de España (IDEE)", + variant: "EL.ElevationGridCoverage", + bounds: [ + [22.173559281306314, -47.0716243806546], + [66.88067635831743, + 40.8749629405498 + ] + ] + }, + variants: { + Elevaciones: {}, + Relieve: "Relieve", + CurvasNivel: { + url: "http://www.ign.es/wms-inspire/mdt?", + options: { + layers: "EL.ContourLine", + transparent: true, + format: "image/png", + minZoom: 12 + } + } + } + }, + // Plan Nacional de Ortofotografia Aerea + PNOA: { + url: "https://www.ign.es/wmts/pnoa-ma?service=WMTS&request=GetTile&version=1.0.0&Format=image/png&layer=OI.OrthoimageCoverage" + completeWMTS, + options: { + attribution: "{attribution.MDT}", + minZoom: 4, + bounds: [ + [22.173559281306314, -47.0716243806546], + [66.88067635831743, + 40.8749629405498 + ] + ] + }, + variants: { + MaximaActualidad: {}, + Mosaico: { + url: "http://www.ign.es/wms-inspire/pnoa-ma?", + options: { + layers: "OI.MosaicElement", + format: "image/png", + transparent: true + } + } + } + }, + // Ocupacion Suelo + OcupacionSuelo: { + url: "https://servicios.idee.es/wmts/ocupacion-suelo?service=WMTS&request=GetTile&version=1.0.0&Format=image/png&layer={variant}&style=default" + completeWMTS, + options: { + attribution: "CC BY 4.0 scne.es. Infraestructura de Datos Espaciales de España (IDEE)", + variant: "LC.LandCoverSurfaces" + }, + variants: { + Ocupacion: {}, + Usos: "LU.ExistingLandUse" + } + }, + // Light Detection and Ranging - LiDAR + LiDAR: { + url: "https://wmts-mapa-lidar.idee.es/lidar?service=WMTS&request=GetTile&version=1.0.0&Format=image/png&layer={variant}" + completeWMTS, + options: { + attribution: "{attribution.MDT}", + variant: "EL.GridCoverageDSM" + } + }, + // Mapa Topografico Nacional + MTN: { + url: "https://ign.es/wmts/mapa-raster?service=WMTS&request=GetTile&version=1.0.0&Format=image/jpeg&layer=MTN&style=default" + completeWMTS, + options: { + attribution: "{attribution.MDT}", + minZoom: 4, + bounds: [ + [22.173559281306314, -47.0716243806546], + [66.88067635831743, + 40.8749629405498 + ] + ] + } + }, + //WMS Servers + Geofisica: { + url: "https://www.ign.es/wms-inspire/geofisica?", + options: { + layers: "Ultimos10dias", + format: "image/png", + transparent: true, + attribution: "{attribution.IGNBase}" + }, + // Selected + variants: { + Terremotos10dias: {}, + Terremotos30dias: "Ultimos30dias", + Terremotos365dias: "Ultimos365dias", + VigilanciaVolcanica: "VigilanciaVolcanica" + } + }, + CaminoDeSantiago: { + url: "https://www.ign.es/wms-inspire/camino-santiago?", + options: { + layers: "camino_frances", + format: "image/png", + transparent: true, + attribution: "CC BY 4.0 ign.es. Federación Española de Asociaciones de Amigos del Camino de Santiago (FEAACS)" + }, + variants: { + CaminoFrances: {}, + CaminosTuronensis: "caminos_turonensis", + CaminosGalicia: "caminos_galicia", + CaminosDelNorte: "caminos_norte", + CaminosAndaluces: "caminos_andaluces", + CaminosCentro: "caminos_centro", + CaminosEste: "caminos_este", + CaminosCatalanes: "caminos_catalanes", + CaminosSureste: "caminos_sureste", + CaminosInsulares: "caminos_insulares", + CaminosPiemonts: "caminos_piemonts", + CaminosTolosana: "caminos_tolosana", + CaminosPortugueses: "caminos_portugueses" + } + }, + Catastro: { + url: "https://ovc.catastro.meh.es/cartografia/INSPIRE/spadgcwms.aspx", + options: { + layers: "CP.CadastralParcel", + transparent: true, + minZoom: 10, + format: "image/png", + attribution: "Spanish General Directorate for Cadastre" + }, + variants: { + Catastro: { + url: "http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx", + options: { + layers: "Catastro", + minZoom: 1, + transparent: false + } + }, + Parcela: { + url: "http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx", + options: { + layers: "PARCELA", + minZoom: 10 + } + }, + CadastralParcel: "CP.CadastralParcel", + CadastralZoning: "CP.CadastralZoning", + Address: "AD.Address", + Building: "BU.Building", + BuildingPart: "BU.BuildingPart", + AdministrativeBoundary: "AU.AdministrativeBoundary", + AdministrativeUnit: "AU.AdministrativeUnit" - L.TileLayer.Provider = L.TileLayer.extend({ - initialize: function (arg, options) { - var providers = L.TileLayer.Provider.providers; - - var parts = arg.split('.'); - - var providerName = parts[0]; - var variantName = parts[1]; - - if (!providers[providerName]) { - throw 'No such provider (' + providerName + ')'; - } - - var provider = { - url: providers[providerName].url, - options: providers[providerName].options - }; - - // overwrite values in provider from variant. - if (variantName && 'variants' in providers[providerName]) { - if (!(variantName in providers[providerName].variants)) { - throw 'No such variant of ' + providerName + ' (' + variantName + ')'; - } - var variant = providers[providerName].variants[variantName]; - var variantOptions; - if (typeof variant === 'string') { - variantOptions = { - variant: variant - }; - } else { - variantOptions = variant.options; - } - provider = { - url: variant.url || provider.url, - options: L.Util.extend({}, provider.options, variantOptions) - }; - } - - // replace attribution placeholders with their values from toplevel provider attribution, - // recursively - var attributionReplacer = function (attr) { - if (attr.indexOf('{attribution.') === -1) { - return attr; - } - return attr.replace(/\{attribution.(\w*)\}/g, - function (match, attributionName) { - return attributionReplacer(providers[attributionName].options.attribution); - } - ); - }; - provider.options.attribution = attributionReplacer(provider.options.attribution); - - // Compute final options combining provider options with any user overrides - var layerOpts = L.Util.extend({}, provider.options, options); - L.TileLayer.prototype.initialize.call(this, provider.url, layerOpts); - } - }); - - /** - * Definition of providers. - * see http://leafletjs.com/reference.html#tilelayer for options in the options map. - */ - - L.TileLayer.Provider.providers = { - OpenStreetMap: { - url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - attribution: - '© OpenStreetMap contributors' - }, - variants: { - Mapnik: {}, - DE: { - url: 'https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', - options: { - maxZoom: 18 - } - }, - CH: { - url: 'https://tile.osm.ch/switzerland/{z}/{x}/{y}.png', - options: { - maxZoom: 18, - bounds: [[45, 5], [48, 11]] - } - }, - France: { - url: 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', - options: { - maxZoom: 20, - attribution: '© Openstreetmap France | {attribution.OpenStreetMap}' - } - }, - HOT: { - url: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', - options: { - attribution: - '{attribution.OpenStreetMap}, ' + - 'Tiles style by Humanitarian OpenStreetMap Team ' + - 'hosted by OpenStreetMap France' - } - }, - BZH: { - url: 'https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png', - options: { - attribution: '{attribution.OpenStreetMap}, Tiles courtesy of Breton OpenStreetMap Team', - bounds: [[46.2, -5.5], [50, 0.7]] - } - } - } - }, - OpenSeaMap: { - url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png', - options: { - attribution: 'Map data: © OpenSeaMap contributors' - } - }, - OpenPtMap: { - url: 'http://openptmap.org/tiles/{z}/{x}/{y}.png', - options: { - maxZoom: 17, - attribution: 'Map data: © OpenPtMap contributors' - } - }, - OpenTopoMap: { - url: 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', - options: { - maxZoom: 17, - attribution: 'Map data: {attribution.OpenStreetMap}, SRTM | Map style: © OpenTopoMap (CC-BY-SA)' - } - }, - OpenRailwayMap: { - url: 'https://{s}.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - attribution: 'Map data: {attribution.OpenStreetMap} | Map style: © OpenRailwayMap (CC-BY-SA)' - } - }, - OpenFireMap: { - url: 'http://openfiremap.org/hytiles/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - attribution: 'Map data: {attribution.OpenStreetMap} | Map style: © OpenFireMap (CC-BY-SA)' - } - }, - SafeCast: { - url: 'https://s3.amazonaws.com/te512.safecast.org/{z}/{x}/{y}.png', - options: { - maxZoom: 16, - attribution: 'Map data: {attribution.OpenStreetMap} | Map style: © SafeCast (CC-BY-SA)' - } - }, - Stadia: { - url: 'https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.png', - options: { - maxZoom: 20, - attribution: '© Stadia Maps, © OpenMapTiles © OpenStreetMap contributors' - }, - variants: { - AlidadeSmooth: { - url: 'https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.png' - }, - AlidadeSmoothDark: { - url: 'https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png' - }, - OSMBright: { - url: 'https://tiles.stadiamaps.com/tiles/osm_bright/{z}/{x}/{y}{r}.png' - }, - Outdoors: { - url: 'https://tiles.stadiamaps.com/tiles/outdoors/{z}/{x}/{y}{r}.png' - } - } - }, - Thunderforest: { - url: 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', - options: { - attribution: - '© Thunderforest, {attribution.OpenStreetMap}', - variant: 'cycle', - apikey: '', - maxZoom: 22 - }, - variants: { - OpenCycleMap: 'cycle', - Transport: { - options: { - variant: 'transport' - } - }, - TransportDark: { - options: { - variant: 'transport-dark' - } - }, - SpinalMap: { - options: { - variant: 'spinal-map' - } - }, - Landscape: 'landscape', - Outdoors: 'outdoors', - Pioneer: 'pioneer', - MobileAtlas: 'mobile-atlas', - Neighbourhood: 'neighbourhood' - } - }, - CyclOSM: { - url: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', - options: { - maxZoom: 20, - attribution: 'CyclOSM | Map data: {attribution.OpenStreetMap}' - } - }, - Hydda: { - url: 'https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png', - options: { - maxZoom: 20, - variant: 'full', - attribution: 'Tiles courtesy of OpenStreetMap Sweden — Map data {attribution.OpenStreetMap}' - }, - variants: { - Full: 'full', - Base: 'base', - RoadsAndLabels: 'roads_and_labels' - } - }, - Jawg: { - url: 'https://{s}.tile.jawg.io/{variant}/{z}/{x}/{y}{r}.png?access-token={accessToken}', - options: { - attribution: - '© JawgMaps ' + - '{attribution.OpenStreetMap}', - minZoom: 0, - maxZoom: 22, - subdomains: 'abcd', - variant: 'jawg-terrain', - // Get your own Jawg access token here : https://www.jawg.io/lab/ - // NB : this is a demonstration key that comes with no guarantee - accessToken: '', - }, - variants: { - Streets: 'jawg-streets', - Terrain: 'jawg-terrain', - Sunny: 'jawg-sunny', - Dark: 'jawg-dark', - Light: 'jawg-light', - Matrix: 'jawg-matrix' - } - }, - MapBox: { - url: 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}{r}?access_token={accessToken}', - options: { - attribution: - '© Mapbox ' + - '{attribution.OpenStreetMap} ' + - 'Improve this map', - tileSize: 512, - maxZoom: 18, - zoomOffset: -1, - id: 'mapbox/streets-v11', - accessToken: '', - } - }, - MapTiler: { - url: 'https://api.maptiler.com/maps/{variant}/{z}/{x}/{y}{r}.{ext}?key={key}', - options: { - attribution: - '© MapTiler © OpenStreetMap contributors', - variant: 'streets', - ext: 'png', - key: '', - tileSize: 512, - zoomOffset: -1, - minZoom: 0, - maxZoom: 21 - }, - variants: { - Streets: 'streets', - Basic: 'basic', - Bright: 'bright', - Pastel: 'pastel', - Positron: 'positron', - Hybrid: { - options: { - variant: 'hybrid', - ext: 'jpg' - } - }, - Toner: 'toner', - Topo: 'topo', - Voyager: 'voyager' - } - }, - Stamen: { - url: 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', - options: { - attribution: - 'Map tiles by Stamen Design, ' + - 'CC BY 3.0 — ' + - 'Map data {attribution.OpenStreetMap}', - subdomains: 'abcd', - minZoom: 0, - maxZoom: 20, - variant: 'toner', - ext: 'png' - }, - variants: { - Toner: 'toner', - TonerBackground: 'toner-background', - TonerHybrid: 'toner-hybrid', - TonerLines: 'toner-lines', - TonerLabels: 'toner-labels', - TonerLite: 'toner-lite', - Watercolor: { - url: 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}', - options: { - variant: 'watercolor', - ext: 'jpg', - minZoom: 1, - maxZoom: 16 - } - }, - Terrain: { - options: { - variant: 'terrain', - minZoom: 0, - maxZoom: 18 - } - }, - TerrainBackground: { - options: { - variant: 'terrain-background', - minZoom: 0, - maxZoom: 18 - } - }, - TerrainLabels: { - options: { - variant: 'terrain-labels', - minZoom: 0, - maxZoom: 18 - } - }, - TopOSMRelief: { - url: 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}', - options: { - variant: 'toposm-color-relief', - ext: 'jpg', - bounds: [[22, -132], [51, -56]] - } - }, - TopOSMFeatures: { - options: { - variant: 'toposm-features', - bounds: [[22, -132], [51, -56]], - opacity: 0.9 - } - } - } - }, - TomTom: { - url: 'https://{s}.api.tomtom.com/map/1/tile/{variant}/{style}/{z}/{x}/{y}.{ext}?key={apikey}', - options: { - variant: 'basic', - maxZoom: 22, - attribution: - '© 1992 - ' + new Date().getFullYear() + ' TomTom. ', - subdomains: 'abcd', - style: 'main', - ext: 'png', - apikey: '', - }, - variants: { - Basic: 'basic', - Hybrid: 'hybrid', - Labels: 'labels' - } - }, - Esri: { - url: 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', - options: { - variant: 'World_Street_Map', - attribution: 'Tiles © Esri' - }, - variants: { - WorldStreetMap: { - options: { - attribution: - '{attribution.Esri} — ' + - 'Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012' - } - }, - DeLorme: { - options: { - variant: 'Specialty/DeLorme_World_Base_Map', - minZoom: 1, - maxZoom: 11, - attribution: '{attribution.Esri} — Copyright: ©2012 DeLorme' - } - }, - WorldTopoMap: { - options: { - variant: 'World_Topo_Map', - attribution: - '{attribution.Esri} — ' + - 'Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community' - } - }, - WorldImagery: { - options: { - variant: 'World_Imagery', - attribution: - '{attribution.Esri} — ' + - 'Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' - } - }, - WorldTerrain: { - options: { - variant: 'World_Terrain_Base', - maxZoom: 13, - attribution: - '{attribution.Esri} — ' + - 'Source: USGS, Esri, TANA, DeLorme, and NPS' - } - }, - WorldShadedRelief: { - options: { - variant: 'World_Shaded_Relief', - maxZoom: 13, - attribution: '{attribution.Esri} — Source: Esri' - } - }, - WorldPhysical: { - options: { - variant: 'World_Physical_Map', - maxZoom: 8, - attribution: '{attribution.Esri} — Source: US National Park Service' - } - }, - OceanBasemap: { - options: { - variant: 'Ocean_Basemap', - maxZoom: 13, - attribution: '{attribution.Esri} — Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri' - } - }, - NatGeoWorldMap: { - options: { - variant: 'NatGeo_World_Map', - maxZoom: 16, - attribution: '{attribution.Esri} — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC' - } - }, - WorldGrayCanvas: { - options: { - variant: 'Canvas/World_Light_Gray_Base', - maxZoom: 16, - attribution: '{attribution.Esri} — Esri, DeLorme, NAVTEQ' - } - } - } - }, - OpenWeatherMap: { - url: 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', - options: { - maxZoom: 19, - attribution: 'Map data © OpenWeatherMap', - apiKey:'', - opacity: 0.5 - }, - variants: { - Clouds: 'clouds', - CloudsClassic: 'clouds_cls', - Precipitation: 'precipitation', - PrecipitationClassic: 'precipitation_cls', - Rain: 'rain', - RainClassic: 'rain_cls', - Pressure: 'pressure', - PressureContour: 'pressure_cntr', - Wind: 'wind', - Temperature: 'temp', - Snow: 'snow' - } - }, - HERE: { - /* - * HERE maps, formerly Nokia maps. - * These basemaps are free, but you need an api id and app key. Please sign up at - * https://developer.here.com/plans - */ - url: - 'https://{s}.{base}.maps.api.here.com/maptile/2.1/' + - '{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' + - 'app_id={app_id}&app_code={app_code}&lg={language}', - options: { - attribution: - 'Map © 1987-' + new Date().getFullYear() + ' HERE', - subdomains: '1234', - mapID: 'newest', - 'app_id': '', - 'app_code': '', - base: 'base', - variant: 'normal.day', - maxZoom: 20, - type: 'maptile', - language: 'eng', - format: 'png8', - size: '256' - }, - variants: { - normalDay: 'normal.day', - normalDayCustom: 'normal.day.custom', - normalDayGrey: 'normal.day.grey', - normalDayMobile: 'normal.day.mobile', - normalDayGreyMobile: 'normal.day.grey.mobile', - normalDayTransit: 'normal.day.transit', - normalDayTransitMobile: 'normal.day.transit.mobile', - normalDayTraffic: { - options: { - variant: 'normal.traffic.day', - base: 'traffic', - type: 'traffictile' - } - }, - normalNight: 'normal.night', - normalNightMobile: 'normal.night.mobile', - normalNightGrey: 'normal.night.grey', - normalNightGreyMobile: 'normal.night.grey.mobile', - normalNightTransit: 'normal.night.transit', - normalNightTransitMobile: 'normal.night.transit.mobile', - reducedDay: 'reduced.day', - reducedNight: 'reduced.night', - basicMap: { - options: { - type: 'basetile' - } - }, - mapLabels: { - options: { - type: 'labeltile', - format: 'png' - } - }, - trafficFlow: { - options: { - base: 'traffic', - type: 'flowtile' - } - }, - carnavDayGrey: 'carnav.day.grey', - hybridDay: { - options: { - base: 'aerial', - variant: 'hybrid.day' - } - }, - hybridDayMobile: { - options: { - base: 'aerial', - variant: 'hybrid.day.mobile' - } - }, - hybridDayTransit: { - options: { - base: 'aerial', - variant: 'hybrid.day.transit' - } - }, - hybridDayGrey: { - options: { - base: 'aerial', - variant: 'hybrid.grey.day' - } - }, - hybridDayTraffic: { - options: { - variant: 'hybrid.traffic.day', - base: 'traffic', - type: 'traffictile' - } - }, - pedestrianDay: 'pedestrian.day', - pedestrianNight: 'pedestrian.night', - satelliteDay: { - options: { - base: 'aerial', - variant: 'satellite.day' - } - }, - terrainDay: { - options: { - base: 'aerial', - variant: 'terrain.day' - } - }, - terrainDayMobile: { - options: { - base: 'aerial', - variant: 'terrain.day.mobile' - } - } - } - }, - HEREv3: { - /* - * HERE maps API Version 3. - * These basemaps are free, but you need an API key. Please sign up at - * https://developer.here.com/plans - * Version 3 deprecates the app_id and app_code access in favor of apiKey - * - * Supported access methods as of 2019/12/21: - * @see https://developer.here.com/faqs#access-control-1--how-do-you-control-access-to-here-location-services - */ - url: - 'https://{s}.{base}.maps.ls.hereapi.com/maptile/2.1/' + - '{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' + - 'apiKey={apiKey}&lg={language}', - options: { - attribution: - 'Map © 1987-' + new Date().getFullYear() + ' HERE', - subdomains: '1234', - mapID: 'newest', - apiKey: '', - base: 'base', - variant: 'normal.day', - maxZoom: 20, - type: 'maptile', - language: 'eng', - format: 'png8', - size: '256' - }, - variants: { - normalDay: 'normal.day', - normalDayCustom: 'normal.day.custom', - normalDayGrey: 'normal.day.grey', - normalDayMobile: 'normal.day.mobile', - normalDayGreyMobile: 'normal.day.grey.mobile', - normalDayTransit: 'normal.day.transit', - normalDayTransitMobile: 'normal.day.transit.mobile', - normalNight: 'normal.night', - normalNightMobile: 'normal.night.mobile', - normalNightGrey: 'normal.night.grey', - normalNightGreyMobile: 'normal.night.grey.mobile', - normalNightTransit: 'normal.night.transit', - normalNightTransitMobile: 'normal.night.transit.mobile', - reducedDay: 'reduced.day', - reducedNight: 'reduced.night', - basicMap: { - options: { - type: 'basetile' - } - }, - mapLabels: { - options: { - type: 'labeltile', - format: 'png' - } - }, - trafficFlow: { - options: { - base: 'traffic', - type: 'flowtile' - } - }, - carnavDayGrey: 'carnav.day.grey', - hybridDay: { - options: { - base: 'aerial', - variant: 'hybrid.day' - } - }, - hybridDayMobile: { - options: { - base: 'aerial', - variant: 'hybrid.day.mobile' - } - }, - hybridDayTransit: { - options: { - base: 'aerial', - variant: 'hybrid.day.transit' - } - }, - hybridDayGrey: { - options: { - base: 'aerial', - variant: 'hybrid.grey.day' - } - }, - pedestrianDay: 'pedestrian.day', - pedestrianNight: 'pedestrian.night', - satelliteDay: { - options: { - base: 'aerial', - variant: 'satellite.day' - } - }, - terrainDay: { - options: { - base: 'aerial', - variant: 'terrain.day' - } - }, - terrainDayMobile: { - options: { - base: 'aerial', - variant: 'terrain.day.mobile' - } - } - } - }, - FreeMapSK: { - url: 'https://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg', - options: { - minZoom: 8, - maxZoom: 16, - subdomains: 'abcd', - bounds: [[47.204642, 15.996093], [49.830896, 22.576904]], - attribution: - '{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 Freemap.sk' - } - }, - MtbMap: { - url: 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png', - options: { - attribution: - '{attribution.OpenStreetMap} & USGS' - } - }, - CartoDB: { - url: 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', - options: { - attribution: '{attribution.OpenStreetMap} © CARTO', - subdomains: 'abcd', - maxZoom: 19, - variant: 'light_all' - }, - variants: { - Positron: 'light_all', - PositronNoLabels: 'light_nolabels', - PositronOnlyLabels: 'light_only_labels', - DarkMatter: 'dark_all', - DarkMatterNoLabels: 'dark_nolabels', - DarkMatterOnlyLabels: 'dark_only_labels', - Voyager: 'rastertiles/voyager', - VoyagerNoLabels: 'rastertiles/voyager_nolabels', - VoyagerOnlyLabels: 'rastertiles/voyager_only_labels', - VoyagerLabelsUnder: 'rastertiles/voyager_labels_under' - } - }, - HikeBike: { - url: 'https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - attribution: '{attribution.OpenStreetMap}', - variant: 'hikebike' - }, - variants: { - HikeBike: {}, - HillShading: { - options: { - maxZoom: 15, - variant: 'hillshading' - } - } - } - }, - BasemapAT: { - url: 'https://maps{s}.wien.gv.at/basemap/{variant}/{type}/google3857/{z}/{y}/{x}.{format}', - options: { - maxZoom: 19, - attribution: 'Datenquelle: basemap.at', - subdomains: ['', '1', '2', '3', '4'], - type: 'normal', - format: 'png', - bounds: [[46.358770, 8.782379], [49.037872, 17.189532]], - variant: 'geolandbasemap' - }, - variants: { - basemap: { - options: { - maxZoom: 20, // currently only in Vienna - variant: 'geolandbasemap' - } - }, - grau: 'bmapgrau', - overlay: 'bmapoverlay', - terrain: { - options: { - variant: 'bmapgelaende', - type: 'grau', - format: 'jpeg' - } - }, - surface: { - options: { - variant: 'bmapoberflaeche', - type: 'grau', - format: 'jpeg' - } - }, - highdpi: { - options: { - variant: 'bmaphidpi', - format: 'jpeg' - } - }, - orthofoto: { - options: { - maxZoom: 20, // currently only in Vienna - variant: 'bmaporthofoto30cm', - format: 'jpeg' - } - } - } - }, - nlmaps: { - url: 'https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png', - options: { - minZoom: 6, - maxZoom: 19, - bounds: [[50.5, 3.25], [54, 7.6]], - attribution: 'Kaartgegevens © Kadaster' - }, - variants: { - 'standaard': 'brtachtergrondkaart', - 'pastel': 'brtachtergrondkaartpastel', - 'grijs': 'brtachtergrondkaartgrijs', - 'luchtfoto': { - 'url': 'https://geodata.nationaalgeoregister.nl/luchtfoto/rgb/wmts/2018_ortho25/EPSG:3857/{z}/{x}/{y}.png', - } - } - }, - NASAGIBS: { - url: 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{maxZoom}/{z}/{y}/{x}.{format}', - options: { - attribution: - 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System ' + - '(ESDIS) with funding provided by NASA/HQ.', - bounds: [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], - minZoom: 1, - maxZoom: 9, - format: 'jpg', - time: '', - tilematrixset: 'GoogleMapsCompatible_Level' - }, - variants: { - ModisTerraTrueColorCR: 'MODIS_Terra_CorrectedReflectance_TrueColor', - ModisTerraBands367CR: 'MODIS_Terra_CorrectedReflectance_Bands367', - ViirsEarthAtNight2012: { - options: { - variant: 'VIIRS_CityLights_2012', - maxZoom: 8 - } - }, - ModisTerraLSTDay: { - options: { - variant: 'MODIS_Terra_Land_Surface_Temp_Day', - format: 'png', - maxZoom: 7, - opacity: 0.75 - } - }, - ModisTerraSnowCover: { - options: { - variant: 'MODIS_Terra_Snow_Cover', - format: 'png', - maxZoom: 8, - opacity: 0.75 - } - }, - ModisTerraAOD: { - options: { - variant: 'MODIS_Terra_Aerosol', - format: 'png', - maxZoom: 6, - opacity: 0.75 - } - }, - ModisTerraChlorophyll: { - options: { - variant: 'MODIS_Terra_Chlorophyll_A', - format: 'png', - maxZoom: 7, - opacity: 0.75 - } - } - } - }, - NLS: { - // NLS maps are copyright National library of Scotland. - // http://maps.nls.uk/projects/api/index.html - // Please contact NLS for anything other than non-commercial low volume usage - // - // Map sources: Ordnance Survey 1:1m to 1:63K, 1920s-1940s - // z0-9 - 1:1m - // z10-11 - quarter inch (1:253440) - // z12-18 - one inch (1:63360) - url: 'https://nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg', - options: { - attribution: 'National Library of Scotland Historic Maps', - bounds: [[49.6, -12], [61.7, 3]], - minZoom: 1, - maxZoom: 18, - subdomains: '0123', - } - }, - JusticeMap: { - // Justice Map (http://www.justicemap.org/) - // Visualize race and income data for your community, county and country. - // Includes tools for data journalists, bloggers and community activists. - url: 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', - options: { - attribution: 'Justice Map', - // one of 'county', 'tract', 'block' - size: 'county', - // Bounds for USA, including Alaska and Hawaii - bounds: [[14, -180], [72, -56]] - }, - variants: { - income: 'income', - americanIndian: 'indian', - asian: 'asian', - black: 'black', - hispanic: 'hispanic', - multi: 'multi', - nonWhite: 'nonwhite', - white: 'white', - plurality: 'plural' - } - }, - Wikimedia: { - url: 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', - options: { - attribution: 'Wikimedia', - minZoom: 1, - maxZoom: 19 - } - }, - GeoportailFrance: { - url: 'https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', - options: { - attribution: 'Geoportail France', - bounds: [[-75, -180], [81, 180]], - minZoom: 2, - maxZoom: 18, - // Get your own geoportail apikey here : http://professionnels.ign.fr/ign/contrats/ - // NB : 'choisirgeoportail' is a demonstration key that comes with no guarantee - apikey: 'choisirgeoportail', - format: 'image/jpeg', - style : 'normal', - variant: 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD' - }, - variants: { - parcels: { - options : { - variant: 'CADASTRALPARCELS.PARCELS', - maxZoom: 20, - style : 'bdparcellaire', - format: 'image/png' - } - }, - ignMaps: 'GEOGRAPHICALGRIDSYSTEMS.MAPS', - maps: 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD', - orthos: { - options: { - maxZoom: 19, - variant: 'ORTHOIMAGERY.ORTHOPHOTOS' - } - } - } - }, - OneMapSG: { - url: 'https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png', - options: { - variant: 'Default', - minZoom: 11, - maxZoom: 18, - bounds: [[1.56073, 104.11475], [1.16, 103.502]], - attribution: ' New OneMap | Map data © contributors, Singapore Land Authority' - }, - variants: { - Default: 'Default', - Night: 'Night', - Original: 'Original', - Grey: 'Grey', - LandLot: 'LandLot' - } - }, - USGS: { - url: 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}', - options: { - maxZoom: 20, - attribution: 'Tiles courtesy of the U.S. Geological Survey' - }, - variants: { - USTopo: {}, - USImagery: { - url: 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}' - }, - USImageryTopo: { - url: 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/{z}/{y}/{x}' - } - } - }, - WaymarkedTrails: { - url: 'https://tile.waymarkedtrails.org/{variant}/{z}/{x}/{y}.png', - options: { - maxZoom: 18, - attribution: 'Map data: {attribution.OpenStreetMap} | Map style: © waymarkedtrails.org (CC-BY-SA)' - }, - variants: { - hiking: 'hiking', - cycling: 'cycling', - mtb: 'mtb', - slopes: 'slopes', - riding: 'riding', - skating: 'skating' - } - } - }; - - L.tileLayer.provider = function (provider, options) { - return new L.TileLayer.Provider(provider, options); - }; - - return L; -})); + } + }, + RedTransporte: { + url: "https://servicios.idee.es/wms-inspire/transportes", + options: { + layers: "TN.RoadTransportNetwork.RoadLink", + transparent: true, + format: "image/png", + attribution: "Sistema Geográfico Nacional SCNE" + }, + variants: { + // Selected, there are more, feel free to contribute + Carreteras: {}, + Ferroviario: "TN.RailTransportNetwork.RailwayLink", + Aerodromo: "TN.AirTransportNetwork.AerodromeArea", + AreaServicio: "TN.RoadTransportNetwork.RoadServiceArea", + EstacionesFerroviario: "TN.RailTransportNetwork.RailwayStationArea", + Puertos: "TN.WaterTransportNetwork.PortArea" + } + }, + Cartociudad: { + url: "https://www.cartociudad.es/wms-inspire/direcciones-ccpp", + options: { + attribution: "CC BY 4.0 scne.es Cartociudad", + layers: "codigo-postal", + transparent: true, + minZoom: 14, + format: "image/png" + }, + variants: { + CodigosPostales: {}, + Direcciones: { + options: { + layers: "AD.Address", + minZoom: 15 + } + } + } + }, + NombresGeograficos: { + url: "https://www.ign.es/wms-inspire/ngbe?", + options: { + layers: "GN.GeographicalNames", + format: "image/png", + transparent: true, + attribution: "{attribution.IGNBase}", + minZoom: 6 + } + }, + UnidadesAdm: { + url: "https://www.ign.es/wms-inspire/unidades-administrativas?", + options: { + layers: "AU.AdministrativeBoundary", + format: "image/png", + transparent: true, + attribution: "{attribution.IGNBase}" + }, + variants: { + Limites: "AU.AdministrativeBoundary", + Unidades: "AU.AdministrativeUnit" + } + }, + Hidrografia: { + url: "https://servicios.idee.es/wms-inspire/hidrografia?", + options: { + layers: "HY.PhysicalWaters.Waterbodies", + format: "image/png", + transparent: true, + attribution: "CC BY 4.0 scne.es SCNE" + }, + // Selected, there are more, feel free to contribute + variants: { + MasaAgua: {}, + Cuencas: "HY.PhysicalWaters.Catchments", + Subcuencas: { + url: "https://wms.mapama.gob.es/sig/Agua/SubcuencasCauces/wms.aspx?", + options: { + attribution: "Ministerio para la Transición Ecológica y el Reto Demográfico", + layers: "HY.PhysicalWaters.Catchments" + } + }, + POI: "HY.PhysicalWaters.HydroPointOfInterest", + ManMade: { + options: { + minZoom: 10, + layers: "HY.PhysicalWaters.ManMadeObject" + } + }, + LineaCosta: "HY.PhysicalWaters.LandWaterBoundary", + Rios: { + options: { + layers: "HY.Network", + minZoom: 6 + } + }, + Humedales: "HY.PhysicalWaters.Wetland" + } + }, + Militar: { + url: "http://wms-defensa.idee.es/mapas?", + options: { + layers: "CEGET_1M", + format: "image/png", + transparent: true, + attribution: "Centro Geográfico del Ejército de Tierra (CEGET)" + }, + variants: { + CEGET1M: {}, + CEGETM7814: "CEGET_M7814", + CEGETM7815: "CEGET_M7815", + CEGETM682: "ceget_M682", + CECAF1M: "cecaf_cnv_1M" + } + }, + ADIF: { + url: "http://ideadif.adif.es/services/wms?", + options: { + layers: "TN.RailTransportNetwork.RailwayLink", + format: "image/png", + transparent: true, + attribution: "© ADIF" + }, + variants: { + Vias: {}, + Nodos: "TN.RailTransportNetwork.RailwayNode", + Estaciones: "TN.RailTransportNetwork.RailwayStationNode" + } + }, + LimitesMaritimos: { + url: "http://ideihm.covam.es/ihm-inspire/wms-unidadesmaritimas?", + options: { + layers: "AU.MaritimeBoundary", + format: "image/png", + transparent: true, + attribution: "© Instituto Hidrográfico de la Marina" + }, + variants: { + LimitesMaritimos: {}, + LineasBase: "AU.Baseline" + } + }, + Copernicus: { + url: "https://servicios.idee.es/wms/copernicus-landservice-spain?", + options: { + layers: "CoperPanEuropean", + format: "image/png", + transparent: true, + attribution: "{attribution.IGNBase}" + }, + variants: { + LandCover: {}, + Forest: "HRLForestTCD2015", + ForestLeaf: "HRLForestDLT2015", + WaterWet: "HRLWaterWetT2015", + SoilSeal: "HRLImpervioDens2015", + GrassLand: "HRLGrassLand2015", + Local: "Local", + RiparianGreen: "Copernicus_RZ_GLE", + RiparianLandCover: "Copernicus_RZ_LCLU", + Natura2k: "N2k_LCLU_2012", + UrbanAtlas: { + options: { + layers: "Urban_Atlas_2012", + minZoom: 8 + } + } + } + }, + ParquesNaturales: { + url: "http://sigred.oapn.es/geoserver/LimitesParquesNacionalesZPP/wms?", + options: { + layers: "view_red_oapn_limite_pn", + format: "image/png", + transparent: true, + attribution: "Ministerio para la Transición Ecológica y el Reto Demográfico" + }, + variants: { + Limites: {}, + ZonasPerifericas: "view_red_oapn_zpp" + } + } +}; +// Adapted from https://github.com/leaflet-extras/leaflet-providers +// Copyright (c) 2013 Leaflet Providers contributors All rights reserved. +// BSD 2-Clause "Simplified" License +function providerOpts(arg, options) { + var providers = providersESP; + var parts = arg.split('.'); + var providerName = parts[0]; + var variantName = parts[1]; + if (!providers[providerName]) { + throw 'No such provider (' + providerName + ')'; + } + var provider = { + url: providers[providerName].url, + options: providers[providerName].options + }; + if (variantName) { + provider.options.providerName = providerName + '.' + variantName; + } else { + provider.options.providerName = providerName; + } + // overwrite values in provider from variant. + if (variantName && 'variants' in providers[providerName]) { + if (!(variantName in providers[providerName].variants)) { + throw 'No such variant of ' + providerName + ' (' + variantName + ')'; + } + var variant = providers[providerName].variants[variantName]; + //Guess WMS or WMTS + var finalurl = variant.url || provider.url; + //According to template Tiles uses {x} while WMS not. + var wmts = finalurl.includes("{x}"); + var variantOptions; + if (typeof variant === 'string') { + // Depending on WMTS or Tiles + if (wmts) { + variantOptions = { + variant: variant + }; + } else { + variantOptions = { + layers: variant + }; + } + } else { + variantOptions = variant.options; + } + provider = { + url: variant.url || provider.url, + options: L.Util.extend({}, provider.options, variantOptions) + }; + } + // replace attribution placeholders with their values from toplevel provider attribution, + // recursively + function attributionReplacer(attr) { + if (attr.indexOf('{attribution.') === -1) { + return attr; + } + return attr.replace(/\{attribution.(\w*)\}/g, function(match, attributionName) { + return attributionReplacer(providers[attributionName].options.attribution); + }); + } + provider.options.attribution = attributionReplacer(provider.options.attribution); + // Compute final options combining provider options with any user overrides + var layerOpts = L.Util.extend({}, provider.options, options); + var providerend = { + url: provider.url, + options: layerOpts + }; + return providerend; +} +L.tileLayer.providerESP = function(name, opts) { + var newprov = providerOpts(name, opts); + var nameurl = newprov.url; + if (nameurl.includes("{x}")) { + return L.tileLayer(newprov.url, newprov.options); + } else { + return L.tileLayer.wms(newprov.url, newprov.options); + } +} diff --git a/data-raw/input/leafletproviders-ESP.html b/data-raw/input/leafletproviders-ESP.html index 3fa37305..75bf56cd 100644 --- a/data-raw/input/leafletproviders-ESP.html +++ b/data-raw/input/leafletproviders-ESP.html @@ -8,29 +8,29 @@ - + - +