-
Notifications
You must be signed in to change notification settings - Fork 327
/
index.html
executable file
·38 lines (33 loc) · 1.26 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
<head>
<style> body { margin: 0; } </style>
<script src="//unpkg.com/globe.gl"></script>
<!--<script src="../../dist/globe.gl.js"></script>-->
</head>
<body>
<div id="globeViz"></div>
<script>
const globe = new Globe(document.getElementById('globeViz'))
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png');
// from https://www.submarinecablemap.com
fetch('//http-proxy.vastur.com?url=https://www.submarinecablemap.com/api/v3/cable/cable-geo.json')
.then(r => r.json())
.then(cablesGeo => {
let cablePaths = [];
cablesGeo.features.forEach(({ geometry, properties }) => {
geometry.coordinates.forEach(coords => cablePaths.push({ coords, properties }));
});
globe
.pathsData(cablePaths)
.pathPoints('coords')
.pathPointLat(p => p[1])
.pathPointLng(p => p[0])
.pathColor(path => path.properties.color)
.pathLabel(path => path.properties.name)
.pathDashLength(0.1)
.pathDashGap(0.008)
.pathDashAnimateTime(12000);
});
</script>
</body>