Update leaflet providers to version 1.1.5.

This commit is contained in:
David Molineus
2015-10-30 23:40:15 +01:00
parent 7d8c0da0d2
commit b49da13abe
9 changed files with 154 additions and 28 deletions

View File

@@ -1,11 +1,14 @@
(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);
}
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['leaflet'], factory);
} else if (typeof modules === 'object' && module.exports) {
// define a Common JS module that relies on 'leaflet'
module.exports = factory(require('leaflet'));
} else {
// Assume Leaflet is loaded into global object L already
factory(L);
}
}(this, function (L) {
'use strict';
@@ -54,6 +57,19 @@
provider.url = 'http:' + provider.url;
}
// If retina option is set
if (provider.options.retina) {
// Check retina screen
if (options.detectRetina && L.Browser.retina) {
// The retina option will be active now
// But we need to prevent Leaflet retina mode
options.detectRetina = false;
} else {
// No retina, remove option
provider.options.retina = '';
}
}
// replace attribution placeholders with their values from toplevel provider attribution,
// recursively
var attributionReplacer = function (attr) {
@@ -222,9 +238,7 @@
}
},
MapBox: {
url: function (id) {
return '//{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
},
url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
options: {
attribution:
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
@@ -233,7 +247,7 @@
}
},
Stamen: {
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.png',
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
options: {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
@@ -490,11 +504,12 @@
}
},
FreeMapSK: {
url: 'http://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
options: {
minZoom: 8,
maxZoom: 16,
subdomains: ['t1', 't2', 't3', 't4'],
subdomains: '1234',
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>'
}
@@ -517,8 +532,10 @@
variants: {
Positron: 'light_all',
PositronNoLabels: 'light_nolabels',
PositronOnlyLabels: 'light_only_labels',
DarkMatter: 'dark_all',
DarkMatterNoLabels: 'dark_nolabels'
DarkMatterNoLabels: 'dark_nolabels',
DarkMatterOnlyLabels: 'dark_only_labels'
}
},
HikeBike: {
@@ -621,6 +638,78 @@
}
}
}
},
NLS: {
// Maps from http://maps.nls.uk/geo/explore/
url: '//nls-{s}.tileserver.com/{variant}/{z}/{x}/{y}.jpg',
options: {
attribution: '<a href="http://geo.nls.uk/maps/">National Library of Scotland Historic Maps</a>',
bounds: [[49.6, -12], [61.7, 3]],
minZoom: 1,
maxZoom: 18,
subdomains: '0123',
},
variants: {
// OS 1:1m to 1:10K, 1900s
// z0-10 - 1:1m
// z11-12 - ?
// z13-14 - one inch (1:63360)
// z15-18 - six inch (1:10560)
'OS_1900': 'NLS_API',
// OS 1:1m to 1:63K, 1920s-1940s
// z0-9 - 1:1m
// z10-11 - quarter inch (1:253440)
// z12-18 - one inch (1:63360)
'OS_1920': 'nls',
'OS_opendata': {
url: 'http://geo.nls.uk/maps/opendata/{z}/{x}/{y}.png',
options: {
maxZoom: 16
}
},
// OS six inch, 1843 - 1882
'OS_6inch_1st': {
url: 'http://geo.nls.uk/maps/os/six_inch/{z}/{x}/{y}.png',
options: {
tms: true,
minZoom: 6,
maxZoom: 16,
bounds: [[49.86261, -8.66444], [60.89421, 1.7785]]
}
},
// OS six inch, 1888 - 1913
'OS_6inch': 'os_6_inch_gb',
// OS 1:25000, 1937 - 1961
'OS_25k': '25k',
// OS one inch, 1945 - 1947
'OS_npe': {
url: 'http://geo.nls.uk/maps/os/newpopular/{z}/{x}/{y}.png',
options: {
tms: true,
minZoom: 3,
maxZoom: 15
}
},
// OS one inch, 1952 - 1961
'OS_7th': 'os7gb',
// OS 1:1056, 1893 - 1896
'OS_London': {
options: {
variant: 'London_1056',
minZoom: 9,
bounds: [[51.177621, -0.708618], [51.618016, 0.355682]]
}
},
'GSGS_Ireland': {
url: 'http://geo.nls.uk/maps/ireland/gsgs4136/{z}/{x}/{y}.png',
options: {
tms: true,
minZoom: 5,
maxZoom: 15,
bounds: [[51.371780, -10.810546], [55.422779, -5.262451]]
}
}
}
}
};