|
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 | ); |
|
342 | 343 | } |
343 | 344 | }, |
344 | 345 | Thunderforest: { |
345 | | - url: 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', |
| 346 | + url: 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}{r}.png?apikey={apikey}', |
346 | 347 | options: { |
347 | 348 | attribution: |
348 | 349 | '© <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}', |
|
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: { |
|
443 | 444 | maxZoom: 21 |
444 | 445 | }, |
445 | 446 | variants: { |
446 | | - Streets: 'streets', |
447 | | - Basic: 'basic', |
448 | | - Bright: 'bright', |
| 447 | + Streets: 'streets-v2', |
| 448 | + Basic: 'basic-v2', |
| 449 | + Bright: 'bright-v2', |
449 | 450 | Pastel: 'pastel', |
450 | 451 | Positron: 'positron', |
451 | 452 | Hybrid: { |
|
454 | 455 | ext: 'jpg' |
455 | 456 | } |
456 | 457 | }, |
457 | | - Toner: 'toner', |
458 | | - Topo: 'topo', |
459 | | - Voyager: 'voyager', |
| 458 | + Toner: 'toner-v2', |
| 459 | + Topo: 'topo-v2', |
| 460 | + Voyager: 'voyager-v2', |
460 | 461 | Ocean: 'ocean', |
461 | 462 | Backdrop: 'backdrop', |
462 | | - Dataviz: 'dataviz' |
| 463 | + Dataviz: 'dataviz', |
| 464 | + DatavizLight: 'dataviz-light', |
| 465 | + DatavizDark: 'dataviz-dark', |
| 466 | + Aquarelle: { |
| 467 | + options: { |
| 468 | + variant: 'aquarelle', |
| 469 | + ext: 'webp' |
| 470 | + } |
| 471 | + }, |
| 472 | + Landscape: 'landscape', |
| 473 | + Openstreetmap: { |
| 474 | + options: { |
| 475 | + variant: 'openstreetmap', |
| 476 | + ext: 'jpg' |
| 477 | + } |
| 478 | + }, |
| 479 | + Outdoor: 'outdoor-v2', |
| 480 | + Satellite: { |
| 481 | + options: { |
| 482 | + variant: 'satellite', |
| 483 | + ext: 'jpg' |
| 484 | + } |
| 485 | + }, |
| 486 | + Winter: 'winter-v2', |
463 | 487 | } |
464 | 488 | }, |
465 | 489 | TomTom: { |
|
579 | 603 | } |
580 | 604 | }, |
581 | 605 | HERE: { |
| 606 | + |
582 | 607 | /* |
583 | 608 | * HERE maps, formerly Nokia maps. |
584 | 609 | * These basemaps are free, but you need an api id and app key. Please sign up at |
|
593 | 618 | 'Map © 1987-' + new Date().getFullYear() + ' <a href="http://developer.here.com">HERE</a>', |
594 | 619 | subdomains: '1234', |
595 | 620 | mapID: 'newest', |
596 | | - 'app_id': '<insert your app_id here>', |
597 | | - 'app_code': '<insert your app_code here>', |
| 621 | + app_id: '<insert your app_id here>', |
| 622 | + app_code: '<insert your app_code here>', |
598 | 623 | base: 'base', |
599 | 624 | variant: 'normal.day', |
600 | 625 | maxZoom: 20, |
|
698 | 723 | } |
699 | 724 | }, |
700 | 725 | HEREv3: { |
| 726 | + |
701 | 727 | /* |
702 | 728 | * HERE maps API Version 3. |
703 | 729 | * These basemaps are free, but you need an API key. Please sign up at |
|
918 | 944 | attribution: 'Kaartgegevens © <a href="https://www.kadaster.nl">Kadaster</a>' |
919 | 945 | }, |
920 | 946 | 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', |
| 947 | + standaard: 'standaard', |
| 948 | + pastel: 'pastel', |
| 949 | + grijs: 'grijs', |
| 950 | + water: 'water', |
| 951 | + luchtfoto: { |
| 952 | + url: 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_ortho25/EPSG:3857/{z}/{x}/{y}.jpeg', |
927 | 953 | } |
928 | 954 | } |
929 | 955 | }, |
|
1135 | 1161 | } |
1136 | 1162 | }, |
1137 | 1163 | AzureMaps: { |
1138 | | - url: |
1139 | | - 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+ |
1140 | | - '&tilesetId={variant}&x={x}&y={y}&zoom={z}&language={language}'+ |
| 1164 | + url: |
| 1165 | + 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' + |
| 1166 | + '&tilesetId={variant}&x={x}&y={y}&zoom={z}&language={language}' + |
1141 | 1167 | '&subscription-key={subscriptionKey}', |
1142 | 1168 | options: { |
1143 | 1169 | attribution: 'See https://docs.microsoft.com/en-us/rest/api/maps/render-v2/get-map-tile for details.', |
|
1153 | 1179 | MicrosoftBaseHybridRoad: 'microsoft.base.hybrid.road', |
1154 | 1180 | MicrosoftTerraMain: 'microsoft.terra.main', |
1155 | 1181 | MicrosoftWeatherInfraredMain: { |
1156 | | - url: |
1157 | | - 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+ |
1158 | | - '&tilesetId={variant}&x={x}&y={y}&zoom={z}'+ |
| 1182 | + url: |
| 1183 | + 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' + |
| 1184 | + '&tilesetId={variant}&x={x}&y={y}&zoom={z}' + |
1159 | 1185 | '&timeStamp={timeStamp}&language={language}' + |
1160 | 1186 | '&subscription-key={subscriptionKey}', |
1161 | 1187 | options: { |
|
1165 | 1191 | }, |
1166 | 1192 | }, |
1167 | 1193 | MicrosoftWeatherRadarMain: { |
1168 | | - url: |
1169 | | - 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+ |
1170 | | - '&tilesetId={variant}&x={x}&y={y}&zoom={z}'+ |
| 1194 | + url: |
| 1195 | + 'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' + |
| 1196 | + '&tilesetId={variant}&x={x}&y={y}&zoom={z}' + |
1171 | 1197 | '&timeStamp={timeStamp}&language={language}' + |
1172 | 1198 | '&subscription-key={subscriptionKey}', |
1173 | 1199 | options: { |
|
1197 | 1223 | } |
1198 | 1224 | } |
1199 | 1225 | }, |
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 | | - } |
| 1226 | + TopPlusOpen: { |
| 1227 | + url: 'http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/{variant}/default/WEBMERCATOR/{z}/{y}/{x}.png', |
| 1228 | + options: { |
| 1229 | + maxZoom: 18, |
| 1230 | + attribution: 'Map data: © <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>', |
| 1231 | + variant: 'web', |
| 1232 | + }, |
| 1233 | + variants: { |
| 1234 | + Color: 'web', |
| 1235 | + Grey: 'web_grau' |
| 1236 | + } |
| 1237 | + } |
1212 | 1238 | }; |
1213 | 1239 |
|
1214 | | - L.tileLayer.provider = function (provider, options) { |
| 1240 | + L.tileLayer.provider = function(provider, options) { |
1215 | 1241 | return new L.TileLayer.Provider(provider, options); |
1216 | 1242 | }; |
1217 | 1243 |
|
|
0 commit comments