|
1 | | -(function (root, factory) { |
| 1 | +(function(root, factory) { |
2 | 2 | if (typeof define === 'function' && define.amd) { |
3 | 3 | // AMD. Register as an anonymous module. |
4 | 4 | define(['leaflet'], factory); |
|
9 | 9 | // Assume Leaflet is loaded into global object L already |
10 | 10 | factory(L); |
11 | 11 | } |
12 | | -}(this, function (L) { |
| 12 | +}(this, function(L) { |
13 | 13 | 'use strict'; |
14 | 14 |
|
15 | 15 | L.TileLayer.Provider = L.TileLayer.extend({ |
16 | | - initialize: function (arg, options) { |
| 16 | + initialize: function(arg, options) { |
17 | 17 | var providers = L.TileLayer.Provider.providers; |
18 | 18 |
|
19 | 19 | var parts = arg.split('.'); |
|
52 | 52 |
|
53 | 53 | // replace attribution placeholders with their values from toplevel provider attribution, |
54 | 54 | // recursively |
55 | | - var attributionReplacer = function (attr) { |
| 55 | + var attributionReplacer = function(attr) { |
56 | 56 | if (attr.indexOf('{attribution.') === -1) { |
57 | 57 | return attr; |
58 | 58 | } |
59 | | - return attr.replace(/\{attribution.(\w*)\}/g, |
60 | | - function (match, attributionName) { |
| 59 | + return attr.replace( |
| 60 | + /\{attribution.(\w*)\}/g, |
| 61 | + function(match, attributionName) { |
61 | 62 | return attributionReplacer(providers[attributionName].options.attribution); |
62 | 63 | } |
63 | 64 | ); |
|
374 | 375 | Neighbourhood: 'neighbourhood' |
375 | 376 | } |
376 | 377 | }, |
377 | | - BaseMapDE: { |
378 | | - url: 'https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/{variant}/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png', |
379 | | - options: { |
380 | | - attribution: 'Map data: © <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>', |
381 | | - variant: 'de_basemapde_web_raster_farbe', |
382 | | - }, |
383 | | - variants: { |
384 | | - Color: 'de_basemapde_web_raster_farbe', |
385 | | - Grey: 'de_basemapde_web_raster_grau' |
386 | | - } |
387 | | - }, |
| 378 | + BaseMapDE: { |
| 379 | + url: 'https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/{variant}/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png', |
| 380 | + options: { |
| 381 | + attribution: 'Map data: © <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>', |
| 382 | + variant: 'de_basemapde_web_raster_farbe', |
| 383 | + }, |
| 384 | + variants: { |
| 385 | + Color: 'de_basemapde_web_raster_farbe', |
| 386 | + Grey: 'de_basemapde_web_raster_grau' |
| 387 | + } |
| 388 | + }, |
388 | 389 | CyclOSM: { |
389 | 390 | url: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', |
390 | 391 | options: { |
|
579 | 580 | } |
580 | 581 | }, |
581 | 582 | HERE: { |
| 583 | + |
582 | 584 | /* |
583 | 585 | * HERE maps, formerly Nokia maps. |
584 | 586 | * These basemaps are free, but you need an api id and app key. Please sign up at |
|
593 | 595 | 'Map © 1987-' + new Date().getFullYear() + ' <a href="http://developer.here.com">HERE</a>', |
594 | 596 | subdomains: '1234', |
595 | 597 | mapID: 'newest', |
596 | | - 'app_id': '<insert your app_id here>', |
597 | | - 'app_code': '<insert your app_code here>', |
| 598 | + app_id: '<insert your app_id here>', |
| 599 | + app_code: '<insert your app_code here>', |
598 | 600 | base: 'base', |
599 | 601 | variant: 'normal.day', |
600 | 602 | maxZoom: 20, |
|
698 | 700 | } |
699 | 701 | }, |
700 | 702 | HEREv3: { |
| 703 | + |
701 | 704 | /* |
702 | 705 | * HERE maps API Version 3. |
703 | 706 | * These basemaps are free, but you need an API key. Please sign up at |
|
918 | 921 | attribution: 'Kaartgegevens © <a href="https://www.kadaster.nl">Kadaster</a>' |
919 | 922 | }, |
920 | 923 | variants: { |
921 | | - 'standaard': 'standaard', |
922 | | - 'pastel': 'pastel', |
923 | | - 'grijs': 'grijs', |
924 | | - 'water': 'water', |
925 | | - 'luchtfoto': { |
926 | | - 'url': 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_ortho25/EPSG:3857/{z}/{x}/{y}.jpeg', |
| 924 | + standaard: 'standaard', |
| 925 | + pastel: 'pastel', |
| 926 | + grijs: 'grijs', |
| 927 | + water: 'water', |
| 928 | + luchtfoto: { |
| 929 | + url: 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_ortho25/EPSG:3857/{z}/{x}/{y}.jpeg', |
927 | 930 | } |
928 | 931 | } |
929 | 932 | }, |
|
1135 | 1138 | } |
1136 | 1139 | }, |
1137 | 1140 | AzureMaps: { |
1138 | | - url: |
1139 | | - 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+ |
1140 | | - '&tilesetId={variant}&x={x}&y={y}&zoom={z}&language={language}'+ |
| 1141 | + url: |
| 1142 | + 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' + |
| 1143 | + '&tilesetId={variant}&x={x}&y={y}&zoom={z}&language={language}' + |
1141 | 1144 | '&subscription-key={subscriptionKey}', |
1142 | 1145 | options: { |
1143 | 1146 | attribution: 'See https://docs.microsoft.com/en-us/rest/api/maps/render-v2/get-map-tile for details.', |
|
1153 | 1156 | MicrosoftBaseHybridRoad: 'microsoft.base.hybrid.road', |
1154 | 1157 | MicrosoftTerraMain: 'microsoft.terra.main', |
1155 | 1158 | MicrosoftWeatherInfraredMain: { |
1156 | | - url: |
1157 | | - 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+ |
1158 | | - '&tilesetId={variant}&x={x}&y={y}&zoom={z}'+ |
| 1159 | + url: |
| 1160 | + 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' + |
| 1161 | + '&tilesetId={variant}&x={x}&y={y}&zoom={z}' + |
1159 | 1162 | '&timeStamp={timeStamp}&language={language}' + |
1160 | 1163 | '&subscription-key={subscriptionKey}', |
1161 | 1164 | options: { |
|
1165 | 1168 | }, |
1166 | 1169 | }, |
1167 | 1170 | MicrosoftWeatherRadarMain: { |
1168 | | - url: |
1169 | | - 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+ |
1170 | | - '&tilesetId={variant}&x={x}&y={y}&zoom={z}'+ |
| 1171 | + url: |
| 1172 | + 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' + |
| 1173 | + '&tilesetId={variant}&x={x}&y={y}&zoom={z}' + |
1171 | 1174 | '&timeStamp={timeStamp}&language={language}' + |
1172 | 1175 | '&subscription-key={subscriptionKey}', |
1173 | 1176 | options: { |
|
1197 | 1200 | } |
1198 | 1201 | } |
1199 | 1202 | }, |
1200 | | - TopPlusOpen: { |
1201 | | - url: 'http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/{variant}/default/WEBMERCATOR/{z}/{y}/{x}.png', |
1202 | | - options: { |
1203 | | - maxZoom: 18, |
1204 | | - attribution: 'Map data: © <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>', |
1205 | | - variant: 'web', |
1206 | | - }, |
1207 | | - variants: { |
1208 | | - Color: 'web', |
1209 | | - Grey: 'web_grau' |
1210 | | - } |
1211 | | - } |
| 1203 | + TopPlusOpen: { |
| 1204 | + url: 'http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/{variant}/default/WEBMERCATOR/{z}/{y}/{x}.png', |
| 1205 | + options: { |
| 1206 | + maxZoom: 18, |
| 1207 | + attribution: 'Map data: © <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>', |
| 1208 | + variant: 'web', |
| 1209 | + }, |
| 1210 | + variants: { |
| 1211 | + Color: 'web', |
| 1212 | + Grey: 'web_grau' |
| 1213 | + } |
| 1214 | + } |
1212 | 1215 | }; |
1213 | 1216 |
|
1214 | | - L.tileLayer.provider = function (provider, options) { |
| 1217 | + L.tileLayer.provider = function(provider, options) { |
1215 | 1218 | return new L.TileLayer.Provider(provider, options); |
1216 | 1219 | }; |
1217 | 1220 |
|
|
0 commit comments