mirror of
https://github.com/netzmacht/contao-leaflet-libraries.git
synced 2025-11-29 11:33:44 +01:00
Update leaflet providers library.
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
(function () {
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['leaflet'], factory);
|
||||
} else {
|
||||
// Assume leaflet is loaded into global object L already
|
||||
factory(L);
|
||||
}
|
||||
}(this, function (L) {
|
||||
'use strict';
|
||||
|
||||
L.TileLayer.Provider = L.TileLayer.extend({
|
||||
@@ -41,6 +49,11 @@
|
||||
provider.url = provider.url(parts.splice(1, parts.length - 1).join('.'));
|
||||
}
|
||||
|
||||
var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
|
||||
if (provider.url.indexOf('//') === 0 && forceHTTP) {
|
||||
provider.url = 'http:' + provider.url;
|
||||
}
|
||||
|
||||
// replace attribution placeholders with their values from toplevel provider attribution,
|
||||
// recursively
|
||||
var attributionReplacer = function (attr) {
|
||||
@@ -66,21 +79,33 @@
|
||||
* see http://leafletjs.com/reference.html#tilelayer for options in the options map.
|
||||
*/
|
||||
|
||||
//jshint maxlen:220
|
||||
L.TileLayer.Provider.providers = {
|
||||
OpenStreetMap: {
|
||||
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
maxZoom: 19,
|
||||
attribution:
|
||||
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
},
|
||||
variants: {
|
||||
Mapnik: {},
|
||||
BlackAndWhite: {
|
||||
url: 'http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png'
|
||||
url: 'http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
maxZoom: 18
|
||||
}
|
||||
},
|
||||
DE: {
|
||||
url: 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png'
|
||||
url: 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
maxZoom: 18
|
||||
}
|
||||
},
|
||||
France: {
|
||||
url: 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
attribution: '© Openstreetmap France | {attribution.OpenStreetMap}'
|
||||
}
|
||||
},
|
||||
HOT: {
|
||||
url: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
|
||||
@@ -96,8 +121,15 @@
|
||||
attribution: 'Map data: © <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'
|
||||
}
|
||||
},
|
||||
OpenTopoMap: {
|
||||
url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
maxZoom: 16,
|
||||
attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
|
||||
}
|
||||
},
|
||||
Thunderforest: {
|
||||
url: 'http://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
|
||||
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
attribution:
|
||||
'© <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}',
|
||||
@@ -105,7 +137,18 @@
|
||||
},
|
||||
variants: {
|
||||
OpenCycleMap: 'cycle',
|
||||
Transport: 'transport',
|
||||
Transport: {
|
||||
options: {
|
||||
variant: 'transport',
|
||||
maxZoom: 19
|
||||
}
|
||||
},
|
||||
TransportDark: {
|
||||
options: {
|
||||
variant: 'transport-dark',
|
||||
maxZoom: 19
|
||||
}
|
||||
},
|
||||
Landscape: 'landscape',
|
||||
Outdoors: 'outdoors'
|
||||
}
|
||||
@@ -113,7 +156,6 @@
|
||||
OpenMapSurfer: {
|
||||
url: 'http://openmapsurfer.uni-hd.de/tiles/{variant}/x={x}&y={y}&z={z}',
|
||||
options: {
|
||||
minZoom: 0,
|
||||
maxZoom: 20,
|
||||
variant: 'roads',
|
||||
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> — Map data {attribution.OpenStreetMap}'
|
||||
@@ -137,20 +179,24 @@
|
||||
Hydda: {
|
||||
url: 'http://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
minZoom: 0,
|
||||
maxZoom: 18,
|
||||
variant: 'full',
|
||||
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> — Map data {attribution.OpenStreetMap}'
|
||||
},
|
||||
variants: {
|
||||
Full: 'full',
|
||||
Base: 'base',
|
||||
RoadsAndLabels: 'roads_and_labels',
|
||||
RoadsAndLabels: 'roads_and_labels'
|
||||
}
|
||||
},
|
||||
MapQuestOpen: {
|
||||
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg',
|
||||
/* Mapquest does support https, but with a different subdomain:
|
||||
* https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
|
||||
* which makes implementing protocol relativity impossible.
|
||||
*/
|
||||
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
|
||||
options: {
|
||||
type: 'map',
|
||||
ext: 'jpg',
|
||||
attribution:
|
||||
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> — ' +
|
||||
'Map data {attribution.OpenStreetMap}',
|
||||
@@ -159,18 +205,25 @@
|
||||
variants: {
|
||||
OSM: {},
|
||||
Aerial: {
|
||||
url: 'http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',
|
||||
options: {
|
||||
type: 'sat',
|
||||
attribution:
|
||||
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> — ' +
|
||||
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
|
||||
}
|
||||
},
|
||||
HybridOverlay: {
|
||||
options: {
|
||||
type: 'hyb',
|
||||
ext: 'png',
|
||||
opacity: 0.9
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
MapBox: {
|
||||
url: function (id) {
|
||||
return 'http://{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
|
||||
return '//{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
|
||||
},
|
||||
options: {
|
||||
attribution:
|
||||
@@ -180,7 +233,7 @@
|
||||
}
|
||||
},
|
||||
Stamen: {
|
||||
url: 'http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.png',
|
||||
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
attribution:
|
||||
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
|
||||
@@ -189,7 +242,8 @@
|
||||
subdomains: 'abcd',
|
||||
minZoom: 0,
|
||||
maxZoom: 20,
|
||||
variant: 'toner'
|
||||
variant: 'toner',
|
||||
ext: 'png'
|
||||
},
|
||||
variants: {
|
||||
Toner: 'toner',
|
||||
@@ -198,31 +252,47 @@
|
||||
TonerLines: 'toner-lines',
|
||||
TonerLabels: 'toner-labels',
|
||||
TonerLite: 'toner-lite',
|
||||
Terrain: {
|
||||
options: {
|
||||
variant: 'terrain',
|
||||
minZoom: 4,
|
||||
maxZoom: 18
|
||||
}
|
||||
},
|
||||
TerrainBackground: {
|
||||
options: {
|
||||
variant: 'terrain-background',
|
||||
minZoom: 4,
|
||||
maxZoom: 18
|
||||
}
|
||||
},
|
||||
Watercolor: {
|
||||
options: {
|
||||
variant: 'watercolor',
|
||||
minZoom: 1,
|
||||
maxZoom: 16
|
||||
}
|
||||
},
|
||||
Terrain: {
|
||||
options: {
|
||||
variant: 'terrain',
|
||||
minZoom: 4,
|
||||
maxZoom: 18,
|
||||
bounds: [[22, -132], [70, -56]]
|
||||
}
|
||||
},
|
||||
TerrainBackground: {
|
||||
options: {
|
||||
variant: 'terrain-background',
|
||||
minZoom: 4,
|
||||
maxZoom: 18,
|
||||
bounds: [[22, -132], [70, -56]]
|
||||
}
|
||||
},
|
||||
TopOSMRelief: {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Esri: {
|
||||
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
|
||||
url: '//server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
|
||||
options: {
|
||||
variant: 'World_Street_Map',
|
||||
attribution: 'Tiles © Esri'
|
||||
@@ -308,6 +378,7 @@
|
||||
OpenWeatherMap: {
|
||||
url: 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png',
|
||||
options: {
|
||||
maxZoom: 19,
|
||||
attribution: 'Map data © <a href="http://openweathermap.org">OpenWeatherMap</a>',
|
||||
opacity: 0.5
|
||||
},
|
||||
@@ -336,7 +407,7 @@
|
||||
* envirionments.
|
||||
*/
|
||||
url:
|
||||
'http://{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
|
||||
'//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
|
||||
'maptile/{mapID}/{variant}/{z}/{x}/{y}/256/png8?' +
|
||||
'app_id={app_id}&app_code={app_code}',
|
||||
options: {
|
||||
@@ -348,7 +419,6 @@
|
||||
'app_code': '<insert your app_code here>',
|
||||
base: 'base',
|
||||
variant: 'normal.day',
|
||||
minZoom: 0,
|
||||
maxZoom: 20
|
||||
},
|
||||
variants: {
|
||||
@@ -441,8 +511,7 @@
|
||||
options: {
|
||||
attribution: '{attribution.OpenStreetMap} © <a href="http://cartodb.com/attributions">CartoDB</a>',
|
||||
subdomains: 'abcd',
|
||||
minZoom: 0,
|
||||
maxZoom: 18,
|
||||
maxZoom: 19,
|
||||
variant: 'light_all'
|
||||
},
|
||||
variants: {
|
||||
@@ -451,10 +520,113 @@
|
||||
DarkMatter: 'dark_all',
|
||||
DarkMatterNoLabels: 'dark_nolabels'
|
||||
}
|
||||
},
|
||||
HikeBike: {
|
||||
url: 'http://{s}.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: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
|
||||
options: {
|
||||
maxZoom: 19,
|
||||
attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>',
|
||||
subdomains: ['', '1', '2', '3', '4'],
|
||||
format: 'png',
|
||||
bounds: [[46.358770, 8.782379], [49.037872, 17.189532]],
|
||||
variant: 'geolandbasemap'
|
||||
},
|
||||
variants: {
|
||||
basemap: 'geolandbasemap',
|
||||
grau: 'bmapgrau',
|
||||
overlay: 'bmapoverlay',
|
||||
highdpi: {
|
||||
options: {
|
||||
variant: 'bmaphidpi',
|
||||
format: 'jpeg'
|
||||
}
|
||||
},
|
||||
orthofoto: {
|
||||
options: {
|
||||
variant: 'bmaporthofoto30cm',
|
||||
format: 'jpeg'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
NASAGIBS: {
|
||||
url: '//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 ' +
|
||||
'(<a href="https://earthdata.nasa.gov">ESDIS</a>) 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
L.tileLayer.provider = function (provider, options) {
|
||||
return new L.TileLayer.Provider(provider, options);
|
||||
};
|
||||
}());
|
||||
|
||||
return L;
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user