-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
170 lines (166 loc) · 7.39 KB
/
index.html
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html>
<head>
<title>OpenStreetMap node density</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.1.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.1.0/dist/leaflet.js"></script>
<script src="leaflet-fullHash.js"></script>
</head>
<body>
<div id="map" style="position:absolute; left:0; right:0; top:0; bottom:0; background-color:black;"></div>
<script>
var map = L.map('map', {maxZoom:7, minZoom:0}).setView([38,13], 2);
var attr = 'data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://openstreetmap.org/copyright">ODbL</a>, Imagery © <a href="https://www.openstreetmap.org/user/tyr_asd/">Martin Raifer</a>, <a href="https://creativecommons.org/licenses/by/3.0/">cc-by</a>';
var density2014 = L.tileLayer('https://tyrasd.github.io/osm-node-density/2014/tiles/density/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2015 = L.tileLayer('https://tyrasd.github.io/osm-node-density/2015/tiles/density/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2015 = L.tileLayer('https://tyrasd.github.io/osm-node-density/2015/tiles/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2016 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2016/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2016 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2016/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2017 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2017/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2017 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2017/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2018 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2018/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2018 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2018/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2019 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2019/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2019 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2019/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2020 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2020/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2020 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2020/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2021 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2021/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2021 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2021/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2022 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2022/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2022 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2022/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2023 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2023/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2023 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2023/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
density2024 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2024/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
diff2024 = L.tileLayer('https://s3-eu-west-1.amazonaws.com/osm-node-density/2024/diff/{z}/{x}/{y}.png', {
maxNativeZoom: 7,
attribution: attr
}),
overlay = L.tileLayer('https://api.mapbox.com/styles/v1/openstreetmap/ckasmteyi1tda1ipfis6wqhuq/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoidHlyIiwiYSI6ImNpcTdyZWQwbjAwMmhoeW5zbXc1enJ3cWoifQ.094oUYlT0wZbf2Q2wM-QQQ', {
opacity: 0.75,
attribution: 'overlay © <a href="https://www.mapbox.com/about/maps/">Mapbox</a>'
});
L.control.layers({
"density 2024": density2024,
"difference 2023-2024": diff2024,
"density 2023": density2023,
"difference 2022-2023": diff2023,
"density 2022": density2022,
"difference 2021-2022": diff2022,
"density 2021": density2021,
"difference 2020-2021": diff2021,
"density 2020": density2020,
"difference 2019-2020": diff2020,
"density 2019": density2019,
"difference 2018-2019": diff2019,
"density 2018": density2018,
"difference 2017-2018": diff2018,
"density 2017": density2017,
"difference 2016-2017": diff2017,
"density 2016": density2016,
"difference 2015-2016": diff2016,
"density 2015": density2015,
"difference 2014-2015": diff2015,
"density 2014": density2014
}, {
"locations":overlay
}).addTo(map);
density2024.addTo(map);
overlay.addTo(map);
var hash = new L.Hash(map, {
"latest": density2024,
"2023-2024": diff2024,
"2023": density2023,
"2022-2023": diff2023,
"2022": density2022,
"2021-2022": diff2022,
"2021": density2021,
"2020-2021": diff2021,
"2020": density2020,
"2019-2020": diff2020,
"2019": density2019,
"2018-2019": diff2019,
"2018": density2018,
"2017-2018": diff2018,
"2017": density2017,
"2016-2017": diff2017,
"2016": density2016,
"2015-2016": diff2016,
"2015": density2015,
"2014-2015": diff2015,
"2014": density2014,
"places":overlay
});
L.control.scale({metric:true, imperial:false}).addTo(map);
</script>
<script>
setTimeout(function() {
var script = document.createElement('script');
script.asnyc = 'async';
script.src = 'https://unpkg.com/leaflet.gridlayer.fadeout@0.1.0/Leaflet.GridLayer.FadeOut.js';
document.getElementsByTagName('head')[0].appendChild(script);
}, 2000);
</script>
</body>
</html>