forked from tyrasd/osm-node-density
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
105 lines (101 loc) · 4.52 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
<!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/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/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="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://openstreetmap.org/copyright">ODbL</a>, Imagery © <a href="http://www.openstreetmap.org/user/tyr_asd/">Martin Raifer</a>, <a href="http://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
}),
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
}),
overlay = L.tileLayer('//{s}.tiles.mapbox.com/v4/openstreetmap.map-inh76ba2/{z}/{x}/{y}.png?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 2019": density2019,
"difference 2018-2019": diff2019,
"density 2018": density2018,
"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);
density2019.addTo(map);
overlay.addTo(map);
var hash = new L.Hash(map, {
"latest": density2019,
//"2019": density2019,
"2018-2019": diff2019,
"2018": density2018,
"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/[email protected]/Leaflet.GridLayer.FadeOut.js';
document.getElementsByTagName('head')[0].appendChild(script);
}, 2000);
</script>
</body>
</html>