globe.gl 2.24.5 → 2.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -6
- package/dist/globe.gl.common.js +24 -2
- package/dist/globe.gl.d.ts +5 -0
- package/dist/globe.gl.js +1456 -1079
- package/dist/globe.gl.js.map +1 -1
- package/dist/globe.gl.min.js +4 -4
- package/dist/globe.gl.module.js +24 -2
- package/example/.DS_Store +0 -0
- package/example/clouds/index.html +1 -2
- package/example/datasets/space-track-leo.txt +10032 -0
- package/example/satellites/index.html +86 -0
- package/example/satellites/preview.png +0 -0
- package/package.json +8 -8
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<style>
|
|
3
|
+
body { margin: 0; }
|
|
4
|
+
|
|
5
|
+
#time-log {
|
|
6
|
+
position: absolute;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
font-family: sans-serif;
|
|
9
|
+
padding: 5px;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
background-color: rgba(200, 200, 200, 0.1);
|
|
12
|
+
color: lavender;
|
|
13
|
+
bottom: 10px;
|
|
14
|
+
right: 10px;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
|
|
18
|
+
<script src="//unpkg.com/three"></script>
|
|
19
|
+
<script src="//unpkg.com/satellite.js/dist/satellite.min.js"></script>
|
|
20
|
+
|
|
21
|
+
<script src="//unpkg.com/globe.gl"></script>
|
|
22
|
+
<!-- <script src="../../dist/globe.gl.js"></script>-->
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body>
|
|
26
|
+
<div id="chart"></div>
|
|
27
|
+
<div id="time-log"></div>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
const EARTH_RADIUS_KM = 6371; // km
|
|
31
|
+
const SAT_SIZE = 80; // km
|
|
32
|
+
const TIME_STEP = 3 * 1000; // per frame
|
|
33
|
+
|
|
34
|
+
const timeLogger = document.getElementById('time-log');
|
|
35
|
+
|
|
36
|
+
const world = Globe()
|
|
37
|
+
(document.getElementById('chart'))
|
|
38
|
+
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
|
|
39
|
+
.objectLat('lat')
|
|
40
|
+
.objectLng('lng')
|
|
41
|
+
.objectAltitude('alt')
|
|
42
|
+
.objectLabel('name');
|
|
43
|
+
|
|
44
|
+
setTimeout(() => world.pointOfView({ altitude: 3.5 }));
|
|
45
|
+
|
|
46
|
+
const satGeometry = new THREE.OctahedronGeometry(SAT_SIZE * world.getGlobeRadius() / EARTH_RADIUS_KM / 2, 0);
|
|
47
|
+
const satMaterial = new THREE.MeshLambertMaterial({ color: 'palegreen', transparent: true, opacity: 0.7 });
|
|
48
|
+
world.objectThreeObject(() => new THREE.Mesh(satGeometry, satMaterial));
|
|
49
|
+
|
|
50
|
+
fetch('../datasets/space-track-leo.txt').then(r => r.text()).then(rawData => {
|
|
51
|
+
const tleData = rawData.replace(/\r/g, '')
|
|
52
|
+
.split(/\n(?=[^12])/)
|
|
53
|
+
.filter(d => d)
|
|
54
|
+
.map(tle => tle.split('\n'));
|
|
55
|
+
const satData = tleData.map(([name, ...tle]) => ({
|
|
56
|
+
satrec: satellite.twoline2satrec(...tle),
|
|
57
|
+
name: name.trim().replace(/^0 /, '')
|
|
58
|
+
}))
|
|
59
|
+
// exclude those that can't be propagated
|
|
60
|
+
.filter(d => !!satellite.propagate(d.satrec, new Date()).position);
|
|
61
|
+
|
|
62
|
+
// time ticker
|
|
63
|
+
let time = new Date();
|
|
64
|
+
(function frameTicker() {
|
|
65
|
+
requestAnimationFrame(frameTicker);
|
|
66
|
+
|
|
67
|
+
time = new Date(+time + TIME_STEP);
|
|
68
|
+
timeLogger.innerText = time.toString();
|
|
69
|
+
|
|
70
|
+
// Update satellite positions
|
|
71
|
+
const gmst = satellite.gstime(time);
|
|
72
|
+
satData.forEach(d => {
|
|
73
|
+
const eci = satellite.propagate(d.satrec, time);
|
|
74
|
+
if (eci.position) {
|
|
75
|
+
const gdPos = satellite.eciToGeodetic(eci.position, gmst);
|
|
76
|
+
d.lat = satellite.radiansToDegrees(gdPos.latitude);
|
|
77
|
+
d.lng = satellite.radiansToDegrees(gdPos.longitude);
|
|
78
|
+
d.alt = gdPos.height / EARTH_RADIUS_KM
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
world.objectsData(satData);
|
|
83
|
+
})();
|
|
84
|
+
});
|
|
85
|
+
</script>
|
|
86
|
+
</body>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "globe.gl",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.2",
|
|
4
4
|
"description": "UI component for Globe Data Visualization using ThreeJS/WebGL",
|
|
5
5
|
"unpkg": "dist/globe.gl.min.js",
|
|
6
6
|
"jsdelivr": "dist/globe.gl.min.js",
|
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
"accessor-fn": "1",
|
|
44
44
|
"kapsule": "^1.13",
|
|
45
45
|
"three": ">=0.118 <1",
|
|
46
|
-
"three-globe": "^2.
|
|
46
|
+
"three-globe": "^2.23",
|
|
47
47
|
"three-render-objects": "^1.26"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@babel/core": "^7.
|
|
50
|
+
"@babel/core": "^7.17.5",
|
|
51
51
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
52
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
52
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
|
|
53
53
|
"@babel/preset-env": "^7.16.11",
|
|
54
|
-
"@rollup/plugin-babel": "^5.3.
|
|
55
|
-
"@rollup/plugin-commonjs": "^21.0.
|
|
54
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
55
|
+
"@rollup/plugin-commonjs": "^21.0.2",
|
|
56
56
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
57
|
-
"postcss": "^8.4.
|
|
57
|
+
"postcss": "^8.4.7",
|
|
58
58
|
"rimraf": "^3.0.2",
|
|
59
|
-
"rollup": "^2.
|
|
59
|
+
"rollup": "^2.68.0",
|
|
60
60
|
"rollup-plugin-dts": "^4.1.0",
|
|
61
61
|
"rollup-plugin-postcss": "^4.0.2",
|
|
62
62
|
"rollup-plugin-terser": "^7.0.2",
|