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