more improvements
This commit is contained in:
parent
fb78deeed4
commit
643c9e3106
1 changed files with 9 additions and 3 deletions
|
@ -1,13 +1,15 @@
|
||||||
<script>
|
<script>
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
import * as sjs from "satellite.js";
|
import * as sjs from "satellite.js";
|
||||||
import { onMount } from "svelte";
|
import { onDestroy, onMount } from "svelte";
|
||||||
import tles from "../../static/tle.js";
|
import tles from "../../static/tle.js";
|
||||||
import world110m from "../../static/world-110m.js";
|
import world110m from "../../static/world-110m.js";
|
||||||
import * as topojson from "topojson";
|
import * as topojson from "topojson";
|
||||||
|
|
||||||
export let width = 300;
|
export let width = 300;
|
||||||
|
|
||||||
|
let shouldLoop = true;
|
||||||
|
|
||||||
async function doThing() {
|
async function doThing() {
|
||||||
let satelliteJs = sjs;
|
let satelliteJs = sjs;
|
||||||
var RADIANS = Math.PI / 180;
|
var RADIANS = Math.PI / 180;
|
||||||
|
@ -338,7 +340,7 @@
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
window.requestAnimationFrame(animateSats);
|
if (shouldLoop) window.requestAnimationFrame(animateSats);
|
||||||
return sats;
|
return sats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,7 +409,7 @@
|
||||||
|
|
||||||
updateSats(date);
|
updateSats(date);
|
||||||
draw();
|
draw();
|
||||||
window.requestAnimationFrame(animateSats);
|
if (shouldLoop) window.requestAnimationFrame(animateSats);
|
||||||
}
|
}
|
||||||
|
|
||||||
initGlobe();
|
initGlobe();
|
||||||
|
@ -418,6 +420,10 @@
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
doThing();
|
doThing();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
shouldLoop = false;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="globeContainer">
|
<div class="globeContainer">
|
||||||
|
|
Loading…
Reference in a new issue