more improvements

This commit is contained in:
Daniel Vinci 2021-04-30 14:33:02 -06:00
parent fb78deeed4
commit 643c9e3106
No known key found for this signature in database
GPG key ID: 7A700C29916C26CA

View file

@ -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">