Upgrade vendored :leaflet-providers JS to 1.10.2 to update available OSM tile providers and fix deprecated MapBox endpoint.

Before MapBox could no longer be used as an OSM tile provider as they recently deprecated their tile API endpoint (https://blog.mapbox.com/deprecating-studio-classic-styles-d8892ac38cb4)

This update of leaflet-providers from 1.9.1 to 1.10.2 uses the new MapBox endpoint, it also adds new tile providers and removes some ones no longer supported. See https://github.com/leaflet-extras/leaflet-providers/blob/master/CHANGELOG.md#1102-2020-07-31
This commit is contained in:
Cillian O'Ruanaidh
2020-07-31 20:18:15 +01:00
parent 3c23952fd6
commit ef7c7a3e73

View File

@@ -219,66 +219,16 @@
}
},
CyclOSM: {
url: 'https://dev.{s}.tile.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',
url: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',
options: {
maxZoom: 20,
attribution: '<a href="https://github.com/cyclosm/cyclosm-cartocss-style/releases" title="CyclOSM - Open Bicycle render">CyclOSM</a> | Map data: {attribution.OpenStreetMap}'
}
},
OpenMapSurfer: {
url: 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
options: {
maxZoom: 19,
variant: 'roads',
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> | Map data '
},
variants: {
Roads: {
options: {
variant: 'roads',
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
}
},
Hybrid: {
options: {
variant: 'hybrid',
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
}
},
AdminBounds: {
options: {
variant: 'adminb',
maxZoom: 18,
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
}
},
ContourLines: {
options: {
variant: 'asterc',
maxZoom: 18,
minZoom: 13,
attribution: '{attribution.OpenMapSurfer} <a href="https://lpdaac.usgs.gov/products/aster_policies">ASTER GDEM</a>'
}
},
Hillshade: {
options: {
variant: 'asterh',
maxZoom: 18,
attribution: '{attribution.OpenMapSurfer} <a href="https://lpdaac.usgs.gov/products/aster_policies">ASTER GDEM</a>, <a href="http://srtm.csi.cgiar.org/">SRTM</a>'
}
},
ElementsAtRisk: {
options: {
variant: 'elements_at_risk',
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
}
}
}
},
Hydda: {
url: 'https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
options: {
maxZoom: 18,
maxZoom: 20,
variant: 'full',
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
},
@@ -288,18 +238,73 @@
RoadsAndLabels: 'roads_and_labels'
}
},
MapBox: {
url: 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}{r}.png?access_token={accessToken}',
Jawg: {
url: 'https://{s}.tile.jawg.io/{variant}/{z}/{x}/{y}{r}.png?access-token={accessToken}',
options: {
attribution:
'<a href="https://www.mapbox.com/about/maps/" target="_blank">&copy; Mapbox</a> ' +
'<a href="http://jawg.io" title="Tiles Courtesy of Jawg Maps" target="_blank">&copy; <b>Jawg</b>Maps</a> ' +
'{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: '<insert your access token here>',
},
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:
'&copy; <a href="https://www.mapbox.com/about/maps/" target="_blank">Mapbox</a> ' +
'{attribution.OpenStreetMap} ' +
'<a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a>',
subdomains: 'abcd',
id: 'mapbox.streets',
tileSize: 512,
maxZoom: 18,
zoomOffset: -1,
id: 'mapbox/streets-v11',
accessToken: '<insert your access token here>',
}
},
MapTiler: {
url: 'https://api.maptiler.com/maps/{variant}/{z}/{x}/{y}{r}.{ext}?key={key}',
options: {
attribution:
'<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>',
variant: 'streets',
ext: 'png',
key: '<insert your MapTiler Cloud API key here>',
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: {
@@ -719,11 +724,11 @@
}
},
FreeMapSK: {
url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
url: 'https://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
options: {
minZoom: 8,
maxZoom: 16,
subdomains: '1234',
subdomains: 'abcd',
bounds: [[47.204642, 15.996093], [49.830896, 22.576904]],
attribution:
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'