leaflet-providers.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. (function (root, factory) {
  2. if (typeof define === 'function' && define.amd) {
  3. // AMD. Register as an anonymous module.
  4. define(['leaflet'], factory);
  5. } else if (typeof modules === 'object' && module.exports) {
  6. // define a Common JS module that relies on 'leaflet'
  7. module.exports = factory(require('leaflet'));
  8. } else {
  9. // Assume Leaflet is loaded into global object L already
  10. factory(L);
  11. }
  12. }(this, function (L) {
  13. 'use strict';
  14. L.TileLayer.Provider = L.TileLayer.extend({
  15. initialize: function (arg, options) {
  16. var providers = L.TileLayer.Provider.providers;
  17. var parts = arg.split('.');
  18. var providerName = parts[0];
  19. var variantName = parts[1];
  20. if (!providers[providerName]) {
  21. throw 'No such provider (' + providerName + ')';
  22. }
  23. var provider = {
  24. url: providers[providerName].url,
  25. options: providers[providerName].options
  26. };
  27. // overwrite values in provider from variant.
  28. if (variantName && 'variants' in providers[providerName]) {
  29. if (!(variantName in providers[providerName].variants)) {
  30. throw 'No such variant of ' + providerName + ' (' + variantName + ')';
  31. }
  32. var variant = providers[providerName].variants[variantName];
  33. var variantOptions;
  34. if (typeof variant === 'string') {
  35. variantOptions = {
  36. variant: variant
  37. };
  38. } else {
  39. variantOptions = variant.options;
  40. }
  41. provider = {
  42. url: variant.url || provider.url,
  43. options: L.Util.extend({}, provider.options, variantOptions)
  44. };
  45. }
  46. var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
  47. if (provider.url.indexOf('//') === 0 && forceHTTP) {
  48. provider.url = 'http:' + provider.url;
  49. }
  50. // If retina option is set
  51. if (provider.options.retina) {
  52. // Check retina screen
  53. if (options.detectRetina && L.Browser.retina) {
  54. // The retina option will be active now
  55. // But we need to prevent Leaflet retina mode
  56. options.detectRetina = false;
  57. } else {
  58. // No retina, remove option
  59. provider.options.retina = '';
  60. }
  61. }
  62. // replace attribution placeholders with their values from toplevel provider attribution,
  63. // recursively
  64. var attributionReplacer = function (attr) {
  65. if (attr.indexOf('{attribution.') === -1) {
  66. return attr;
  67. }
  68. return attr.replace(/\{attribution.(\w*)\}/,
  69. function (match, attributionName) {
  70. return attributionReplacer(providers[attributionName].options.attribution);
  71. }
  72. );
  73. };
  74. provider.options.attribution = attributionReplacer(provider.options.attribution);
  75. // Compute final options combining provider options with any user overrides
  76. var layerOpts = L.Util.extend({}, provider.options, options);
  77. L.TileLayer.prototype.initialize.call(this, provider.url, layerOpts);
  78. }
  79. });
  80. /**
  81. * Definition of providers.
  82. * see http://leafletjs.com/reference.html#tilelayer for options in the options map.
  83. */
  84. L.TileLayer.Provider.providers = {
  85. OpenStreetMap: {
  86. url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
  87. options: {
  88. maxZoom: 19,
  89. attribution:
  90. '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
  91. },
  92. variants: {
  93. Mapnik: {},
  94. BlackAndWhite: {
  95. url: 'http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png',
  96. options: {
  97. maxZoom: 18
  98. }
  99. },
  100. DE: {
  101. url: 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
  102. options: {
  103. maxZoom: 18
  104. }
  105. },
  106. France: {
  107. url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
  108. options: {
  109. attribution: '&copy; Openstreetmap France | {attribution.OpenStreetMap}'
  110. }
  111. },
  112. HOT: {
  113. url: '//{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
  114. options: {
  115. attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
  116. }
  117. }
  118. }
  119. },
  120. OpenSeaMap: {
  121. url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
  122. options: {
  123. attribution: 'Map data: &copy; <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'
  124. }
  125. },
  126. OpenTopoMap: {
  127. url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
  128. options: {
  129. maxZoom: 17,
  130. attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
  131. }
  132. },
  133. Thunderforest: {
  134. url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
  135. options: {
  136. attribution:
  137. '&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}',
  138. variant: 'cycle'
  139. },
  140. variants: {
  141. OpenCycleMap: 'cycle',
  142. Transport: {
  143. options: {
  144. variant: 'transport',
  145. maxZoom: 19
  146. }
  147. },
  148. TransportDark: {
  149. options: {
  150. variant: 'transport-dark',
  151. maxZoom: 19
  152. }
  153. },
  154. SpinalMap: {
  155. options: {
  156. variant: 'spinal-map',
  157. maxZoom: 11
  158. }
  159. },
  160. Landscape: 'landscape',
  161. Outdoors: 'outdoors',
  162. Pioneer: 'pioneer'
  163. }
  164. },
  165. OpenMapSurfer: {
  166. url: 'http://korona.geog.uni-heidelberg.de/tiles/{variant}/x={x}&y={y}&z={z}',
  167. options: {
  168. maxZoom: 20,
  169. variant: 'roads',
  170. attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> &mdash; Map data {attribution.OpenStreetMap}'
  171. },
  172. variants: {
  173. Roads: 'roads',
  174. AdminBounds: {
  175. options: {
  176. variant: 'adminb',
  177. maxZoom: 19
  178. }
  179. },
  180. Grayscale: {
  181. options: {
  182. variant: 'roadsg',
  183. maxZoom: 19
  184. }
  185. }
  186. }
  187. },
  188. Hydda: {
  189. url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
  190. options: {
  191. variant: 'full',
  192. attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
  193. },
  194. variants: {
  195. Full: 'full',
  196. Base: 'base',
  197. RoadsAndLabels: 'roads_and_labels'
  198. }
  199. },
  200. MapQuestOpen: {
  201. /* Mapquest does support https, but with a different subdomain:
  202. * https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
  203. * which makes implementing protocol relativity impossible.
  204. */
  205. url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
  206. options: {
  207. type: 'map',
  208. ext: 'jpg',
  209. attribution:
  210. 'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
  211. 'Map data {attribution.OpenStreetMap}',
  212. subdomains: '1234'
  213. },
  214. variants: {
  215. OSM: {},
  216. Aerial: {
  217. options: {
  218. type: 'sat',
  219. attribution:
  220. 'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
  221. 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
  222. }
  223. },
  224. HybridOverlay: {
  225. options: {
  226. type: 'hyb',
  227. ext: 'png',
  228. opacity: 0.9
  229. }
  230. }
  231. }
  232. },
  233. MapBox: {
  234. url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
  235. options: {
  236. attribution:
  237. 'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
  238. 'Map data {attribution.OpenStreetMap}',
  239. subdomains: 'abcd'
  240. }
  241. },
  242. Stamen: {
  243. url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
  244. options: {
  245. attribution:
  246. 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
  247. '<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; ' +
  248. 'Map data {attribution.OpenStreetMap}',
  249. subdomains: 'abcd',
  250. minZoom: 0,
  251. maxZoom: 20,
  252. variant: 'toner',
  253. ext: 'png'
  254. },
  255. variants: {
  256. Toner: 'toner',
  257. TonerBackground: 'toner-background',
  258. TonerHybrid: 'toner-hybrid',
  259. TonerLines: 'toner-lines',
  260. TonerLabels: 'toner-labels',
  261. TonerLite: 'toner-lite',
  262. Watercolor: {
  263. options: {
  264. variant: 'watercolor',
  265. minZoom: 1,
  266. maxZoom: 16
  267. }
  268. },
  269. Terrain: {
  270. options: {
  271. variant: 'terrain',
  272. minZoom: 4,
  273. maxZoom: 18,
  274. bounds: [[22, -132], [70, -56]]
  275. }
  276. },
  277. TerrainBackground: {
  278. options: {
  279. variant: 'terrain-background',
  280. minZoom: 4,
  281. maxZoom: 18,
  282. bounds: [[22, -132], [70, -56]]
  283. }
  284. },
  285. TopOSMRelief: {
  286. options: {
  287. variant: 'toposm-color-relief',
  288. ext: 'jpg',
  289. bounds: [[22, -132], [51, -56]]
  290. }
  291. },
  292. TopOSMFeatures: {
  293. options: {
  294. variant: 'toposm-features',
  295. bounds: [[22, -132], [51, -56]],
  296. opacity: 0.9
  297. }
  298. }
  299. }
  300. },
  301. Esri: {
  302. url: '//server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
  303. options: {
  304. variant: 'World_Street_Map',
  305. attribution: 'Tiles &copy; Esri'
  306. },
  307. variants: {
  308. WorldStreetMap: {
  309. options: {
  310. attribution:
  311. '{attribution.Esri} &mdash; ' +
  312. 'Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'
  313. }
  314. },
  315. DeLorme: {
  316. options: {
  317. variant: 'Specialty/DeLorme_World_Base_Map',
  318. minZoom: 1,
  319. maxZoom: 11,
  320. attribution: '{attribution.Esri} &mdash; Copyright: &copy;2012 DeLorme'
  321. }
  322. },
  323. WorldTopoMap: {
  324. options: {
  325. variant: 'World_Topo_Map',
  326. attribution:
  327. '{attribution.Esri} &mdash; ' +
  328. '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'
  329. }
  330. },
  331. WorldImagery: {
  332. options: {
  333. variant: 'World_Imagery',
  334. attribution:
  335. '{attribution.Esri} &mdash; ' +
  336. 'Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
  337. }
  338. },
  339. WorldTerrain: {
  340. options: {
  341. variant: 'World_Terrain_Base',
  342. maxZoom: 13,
  343. attribution:
  344. '{attribution.Esri} &mdash; ' +
  345. 'Source: USGS, Esri, TANA, DeLorme, and NPS'
  346. }
  347. },
  348. WorldShadedRelief: {
  349. options: {
  350. variant: 'World_Shaded_Relief',
  351. maxZoom: 13,
  352. attribution: '{attribution.Esri} &mdash; Source: Esri'
  353. }
  354. },
  355. WorldPhysical: {
  356. options: {
  357. variant: 'World_Physical_Map',
  358. maxZoom: 8,
  359. attribution: '{attribution.Esri} &mdash; Source: US National Park Service'
  360. }
  361. },
  362. OceanBasemap: {
  363. options: {
  364. variant: 'Ocean_Basemap',
  365. maxZoom: 13,
  366. attribution: '{attribution.Esri} &mdash; Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri'
  367. }
  368. },
  369. NatGeoWorldMap: {
  370. options: {
  371. variant: 'NatGeo_World_Map',
  372. maxZoom: 16,
  373. attribution: '{attribution.Esri} &mdash; National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC'
  374. }
  375. },
  376. WorldGrayCanvas: {
  377. options: {
  378. variant: 'Canvas/World_Light_Gray_Base',
  379. maxZoom: 16,
  380. attribution: '{attribution.Esri} &mdash; Esri, DeLorme, NAVTEQ'
  381. }
  382. }
  383. }
  384. },
  385. OpenWeatherMap: {
  386. url: 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png',
  387. options: {
  388. maxZoom: 19,
  389. attribution: 'Map data &copy; <a href="http://openweathermap.org">OpenWeatherMap</a>',
  390. opacity: 0.5
  391. },
  392. variants: {
  393. Clouds: 'clouds',
  394. CloudsClassic: 'clouds_cls',
  395. Precipitation: 'precipitation',
  396. PrecipitationClassic: 'precipitation_cls',
  397. Rain: 'rain',
  398. RainClassic: 'rain_cls',
  399. Pressure: 'pressure',
  400. PressureContour: 'pressure_cntr',
  401. Wind: 'wind',
  402. Temperature: 'temp',
  403. Snow: 'snow'
  404. }
  405. },
  406. HERE: {
  407. /*
  408. * HERE maps, formerly Nokia maps.
  409. * These basemaps are free, but you need an API key. Please sign up at
  410. * http://developer.here.com/getting-started
  411. *
  412. * Note that the base urls contain '.cit' whichs is HERE's
  413. * 'Customer Integration Testing' environment. Please remove for production
  414. * envirionments.
  415. */
  416. url:
  417. '//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
  418. '{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' +
  419. 'app_id={app_id}&app_code={app_code}&lg={language}',
  420. options: {
  421. attribution:
  422. 'Map &copy; 1987-2014 <a href="http://developer.here.com">HERE</a>',
  423. subdomains: '1234',
  424. mapID: 'newest',
  425. 'app_id': '<insert your app_id here>',
  426. 'app_code': '<insert your app_code here>',
  427. base: 'base',
  428. variant: 'normal.day',
  429. maxZoom: 20,
  430. type: 'maptile',
  431. language: 'eng',
  432. format: 'png8',
  433. size: '256'
  434. },
  435. variants: {
  436. normalDay: 'normal.day',
  437. normalDayCustom: 'normal.day.custom',
  438. normalDayGrey: 'normal.day.grey',
  439. normalDayMobile: 'normal.day.mobile',
  440. normalDayGreyMobile: 'normal.day.grey.mobile',
  441. normalDayTransit: 'normal.day.transit',
  442. normalDayTransitMobile: 'normal.day.transit.mobile',
  443. normalNight: 'normal.night',
  444. normalNightMobile: 'normal.night.mobile',
  445. normalNightGrey: 'normal.night.grey',
  446. normalNightGreyMobile: 'normal.night.grey.mobile',
  447. basicMap: {
  448. options: {
  449. type: 'basetile'
  450. }
  451. },
  452. mapLabels: {
  453. options: {
  454. type: 'labeltile',
  455. format: 'png'
  456. }
  457. },
  458. trafficFlow: {
  459. options: {
  460. base: 'traffic',
  461. type: 'flowtile'
  462. }
  463. },
  464. carnavDayGrey: 'carnav.day.grey',
  465. hybridDay: {
  466. options: {
  467. base: 'aerial',
  468. variant: 'hybrid.day'
  469. }
  470. },
  471. hybridDayMobile: {
  472. options: {
  473. base: 'aerial',
  474. variant: 'hybrid.day.mobile'
  475. }
  476. },
  477. pedestrianDay: 'pedestrian.day',
  478. pedestrianNight: 'pedestrian.night',
  479. satelliteDay: {
  480. options: {
  481. base: 'aerial',
  482. variant: 'satellite.day'
  483. }
  484. },
  485. terrainDay: {
  486. options: {
  487. base: 'aerial',
  488. variant: 'terrain.day'
  489. }
  490. },
  491. terrainDayMobile: {
  492. options: {
  493. base: 'aerial',
  494. variant: 'terrain.day.mobile'
  495. }
  496. }
  497. }
  498. },
  499. FreeMapSK: {
  500. url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
  501. options: {
  502. minZoom: 8,
  503. maxZoom: 16,
  504. subdomains: '1234',
  505. bounds: [[47.204642, 15.996093], [49.830896, 22.576904]],
  506. attribution:
  507. '{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
  508. }
  509. },
  510. MtbMap: {
  511. url: 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png',
  512. options: {
  513. attribution:
  514. '{attribution.OpenStreetMap} &amp; USGS'
  515. }
  516. },
  517. CartoDB: {
  518. url: 'http://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png',
  519. options: {
  520. attribution: '{attribution.OpenStreetMap} &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
  521. subdomains: 'abcd',
  522. maxZoom: 19,
  523. variant: 'light_all'
  524. },
  525. variants: {
  526. Positron: 'light_all',
  527. PositronNoLabels: 'light_nolabels',
  528. PositronOnlyLabels: 'light_only_labels',
  529. DarkMatter: 'dark_all',
  530. DarkMatterNoLabels: 'dark_nolabels',
  531. DarkMatterOnlyLabels: 'dark_only_labels'
  532. }
  533. },
  534. HikeBike: {
  535. url: 'http://{s}.tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png',
  536. options: {
  537. maxZoom: 19,
  538. attribution: '{attribution.OpenStreetMap}',
  539. variant: 'hikebike'
  540. },
  541. variants: {
  542. HikeBike: {},
  543. HillShading: {
  544. options: {
  545. maxZoom: 15,
  546. variant: 'hillshading'
  547. }
  548. }
  549. }
  550. },
  551. BasemapAT: {
  552. url: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
  553. options: {
  554. maxZoom: 19,
  555. attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>',
  556. subdomains: ['', '1', '2', '3', '4'],
  557. format: 'png',
  558. bounds: [[46.358770, 8.782379], [49.037872, 17.189532]],
  559. variant: 'geolandbasemap'
  560. },
  561. variants: {
  562. basemap: 'geolandbasemap',
  563. grau: 'bmapgrau',
  564. overlay: 'bmapoverlay',
  565. highdpi: {
  566. options: {
  567. variant: 'bmaphidpi',
  568. format: 'jpeg'
  569. }
  570. },
  571. orthofoto: {
  572. options: {
  573. variant: 'bmaporthofoto30cm',
  574. format: 'jpeg'
  575. }
  576. }
  577. }
  578. },
  579. NASAGIBS: {
  580. url: '//map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{maxZoom}/{z}/{y}/{x}.{format}',
  581. options: {
  582. attribution:
  583. 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System ' +
  584. '(<a href="https://earthdata.nasa.gov">ESDIS</a>) with funding provided by NASA/HQ.',
  585. bounds: [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
  586. minZoom: 1,
  587. maxZoom: 9,
  588. format: 'jpg',
  589. time: '',
  590. tilematrixset: 'GoogleMapsCompatible_Level'
  591. },
  592. variants: {
  593. ModisTerraTrueColorCR: 'MODIS_Terra_CorrectedReflectance_TrueColor',
  594. ModisTerraBands367CR: 'MODIS_Terra_CorrectedReflectance_Bands367',
  595. ViirsEarthAtNight2012: {
  596. options: {
  597. variant: 'VIIRS_CityLights_2012',
  598. maxZoom: 8
  599. }
  600. },
  601. ModisTerraLSTDay: {
  602. options: {
  603. variant: 'MODIS_Terra_Land_Surface_Temp_Day',
  604. format: 'png',
  605. maxZoom: 7,
  606. opacity: 0.75
  607. }
  608. },
  609. ModisTerraSnowCover: {
  610. options: {
  611. variant: 'MODIS_Terra_Snow_Cover',
  612. format: 'png',
  613. maxZoom: 8,
  614. opacity: 0.75
  615. }
  616. },
  617. ModisTerraAOD: {
  618. options: {
  619. variant: 'MODIS_Terra_Aerosol',
  620. format: 'png',
  621. maxZoom: 6,
  622. opacity: 0.75
  623. }
  624. },
  625. ModisTerraChlorophyll: {
  626. options: {
  627. variant: 'MODIS_Terra_Chlorophyll_A',
  628. format: 'png',
  629. maxZoom: 7,
  630. opacity: 0.75
  631. }
  632. }
  633. }
  634. },
  635. NLS: {
  636. // NLS maps are copyright National library of Scotland.
  637. // http://maps.nls.uk/projects/api/index.html
  638. // Please contact NLS for anything other than non-commercial low volume usage
  639. //
  640. // Map sources: Ordnance Survey 1:1m to 1:63K, 1920s-1940s
  641. // z0-9 - 1:1m
  642. // z10-11 - quarter inch (1:253440)
  643. // z12-18 - one inch (1:63360)
  644. url: '//nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg',
  645. options: {
  646. attribution: '<a href="http://geo.nls.uk/maps/">National Library of Scotland Historic Maps</a>',
  647. bounds: [[49.6, -12], [61.7, 3]],
  648. minZoom: 1,
  649. maxZoom: 18,
  650. subdomains: '0123',
  651. }
  652. }
  653. };
  654. L.tileLayer.provider = function (provider, options) {
  655. return new L.TileLayer.Provider(provider, options);
  656. };
  657. return L;
  658. }));