-
-
Notifications
You must be signed in to change notification settings - Fork 258
/
Copy pathindex.html
74 lines (72 loc) · 3.14 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
<!DOCTYPE html>
<html lang="ja_JP" style="overscroll-behavior: none;">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7NP0LHFG11"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7NP0LHFG11');
</script>
<meta charset="utf-8" />
<link rel="stylesheet" href="mini-tokyo-3d.min.css" />
<title>Mini Tokyo 3D</title>
<meta name="description" content="A real-time 3D digital map of Tokyo's public transport system. This data visualization was produced by Akihiko Kusanagi." />
<meta name="viewport" content="user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, width=device-width, height=device-height, initial-scale=1" />
<meta property="og:title" content="Mini Tokyo 3D" />
<meta property="og:description" content="A real-time 3D digital map of Tokyo's public transport system. This data visualization was produced by Akihiko Kusanagi." />
<meta property="og:locale" content="ja_JP" />
<link rel="canonical" href="https://minitokyo3d.com" />
<meta property="og:url" content="https://minitokyo3d.com" />
<meta property="og:site_name" content="Mini Tokyo 3D" />
<meta property="og:image" content="https://minitokyo3d.com/images/screenshot1.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@nagix" />
<script src="mini-tokyo-3d.min.js"></script>
<script src="mt3d-plugin-precipitation.min.js"></script>
<script src="mt3d-plugin-fireworks.min.js"></script>
<script src="mt3d-plugin-livecam.min.js"></script>
<script src="mt3d-plugin-plateau.min.js"></script>
</head>
<body style="width: 100%; height: 100%; margin: 0; padding: 0; position: absolute;">
<div id="map" style="width: 100%; height: 100%;"></div>
<script>
const matchLang = location.search.match(/lang=(.*?)(?:&|$)/),
matchSelection = location.search.match(/selection=(.*?)(?:&|$)/),
matchGtfsUrl = location.search.match(/gtfsurl=(.*?)(?:&|$)/),
matchVehiclePositionUrl = location.search.match(/gtfsvpurl=(.*?)(?:&|$)/),
matchGtfsColor = location.search.match(/gtfscolor=(.*?)(?:&|$)/),
matchHash = location.hash.match(/[^\d\.\-]*([\d\.\-]*)\/?([\d\.\-]*)\/?([\d\.\-]*)\/?([\d\.\-]*)\/?([\d\.\-]*)/),
options = {
container: 'map',
plugins: [mt3dPrecipitation(), mt3dFireworks(), mt3dLivecam(), mt3dPlateau({enabled: false})]
};
if (matchLang) {
options.lang = decodeURIComponent(matchLang[1]);
}
if (matchSelection) {
options.selection = decodeURIComponent(matchSelection[1]);
}
if (matchHash[1]) {
options.zoom = +matchHash[1];
}
if (matchHash[2] && matchHash[3]) {
options.center = [+matchHash[3], +matchHash[2]];
}
if (matchHash[4]) {
options.bearing = +matchHash[4];
}
if (matchHash[5]) {
options.pitch = +matchHash[5];
}
if (matchGtfsUrl && matchVehiclePositionUrl && matchGtfsColor) {
options.dataSources = [{
gtfsUrl: decodeURIComponent(matchGtfsUrl[1]),
vehiclePositionUrl: decodeURIComponent(matchVehiclePositionUrl[1]),
color: `#${decodeURIComponent(matchGtfsColor[1])}`
}];
}
const map = new mt3d.Map(options);
</script>
</body>
</html>