-
Notifications
You must be signed in to change notification settings - Fork 0
/
jawgLayers.js
105 lines (103 loc) · 4.52 KB
/
jawgLayers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
const jawgTOKEN = searchParam.get(`jawg`) || localStorage.getItem(`jawg`);
const thunderforest = searchParam.get(`thunderforest`) || localStorage.getItem(`thunderforest`);
if (!plot && jawgTOKEN && !mapGotLayer) {
switch (LAYER) {
case `dark`:
var Jawg_Dark = L.tileLayer(
"https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png?access-token={accessToken}",
{
attribution:
'<a href="http://jawg.io" title="Tiles Courtesy of Jawg Maps" target="_blank">© <b>Jawg</b>Maps</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
minZoom: 0,
maxZoom: 22,
subdomains: "abcd",
accessToken: jawgTOKEN,
}
);
addLayerToMap(Jawg_Dark)
break;
case `opnvkarte`:
var OPNVKarte = L.tileLayer(
"https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png",
{
maxZoom: 18,
attribution:
'Map <a href="https://memomaps.de/">memomaps.de</a> <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
accessToken: jawgTOKEN,
}
);
addLayerToMap(OPNVKarte);
break;
case `streets`:
var Jawg_Streets = L.tileLayer(
"https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png?access-token={accessToken}",
{
attribution:
'<a href="http://jawg.io" title="Tiles Courtesy of Jawg Maps" target="_blank">© <b>Jawg</b>Maps</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
minZoom: 0,
maxZoom: 22,
subdomains: "abcd",
accessToken: jawgTOKEN,
}
);
addLayerToMap(Jawg_Streets)
break;
case `sunny`:
var Jawg_Sunny = L.tileLayer(
"https://{s}.tile.jawg.io/jawg-sunny/{z}/{x}/{y}{r}.png?access-token={accessToken}",
{
attribution:
'<a href="http://jawg.io" title="Tiles Courtesy of Jawg Maps" target="_blank">© <b>Jawg</b>Maps</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
minZoom: 0,
maxZoom: 22,
subdomains: "abcd",
accessToken: jawgTOKEN,
}
);
addLayerToMap(Jawg_Sunny)
break;
case `matrix`:
var Jawg_Matrix = L.tileLayer(
"https://{s}.tile.jawg.io/jawg-matrix/{z}/{x}/{y}{r}.png?access-token={accessToken}",
{
attribution:
'<a href="http://jawg.io" title="Tiles Courtesy of Jawg Maps" target="_blank">© <b>Jawg</b>Maps</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
minZoom: 0,
maxZoom: 22,
subdomains: "abcd",
accessToken: jawgTOKEN,
}
);
addLayerToMap(Jawg_Matrix)
break;
}
}
// https://manage.thunderforest.com/dashboard
if (!plot && thunderforest && !mapGotLayer) {
switch (LAYER) {
case `spinal`:
let Thunderforest_SpinalMap = L.tileLayer('https://{s}.tile.thunderforest.com/spinal-map/{z}/{x}/{y}.png?apikey={apikey}', {
attribution: '© <a href="http://www.thunderforest.com/">Thunderforest</a>, © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
apikey: thunderforest,
maxZoom: 22
});
addLayerToMap(Thunderforest_SpinalMap)
break;
case `landscape`:
let Thunderforest_Landscape = L.tileLayer('https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey={apikey}', {
attribution: '© <a href="http://www.thunderforest.com/">Thunderforest</a>, © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
apikey: thunderforest,
maxZoom: 22
});
addLayerToMap(Thunderforest_Landscape)
break;
case `transport`:
let Thunderforest_Transport = L.tileLayer('https://{s}.tile.thunderforest.com/transport/{z}/{x}/{y}.png?apikey={apikey}', {
attribution: '© <a href="http://www.thunderforest.com/">Thunderforest</a>, © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
apikey: thunderforest,
maxZoom: 22
});
addLayerToMap(Thunderforest_Transport)
break;
}
}