fix legendless bug

This commit is contained in:
2023-11-02 10:48:53 -04:00
parent 8676ae3950
commit befe832516

View File

@@ -239,9 +239,12 @@ function makeLegend() {
} }
function updateLegend(shotcount = undefined) { function updateLegend(shotcount = undefined) {
if (!useLegend) return;
try {
document.getElementById( document.getElementById(
"shotCounter" "shotCounter"
).textContent = `Previous update created ${shotcount} migrations`; ).textContent = `Previous update created ${shotcount} migrations`;
} catch {}
} }
const space_coords = [43.09224, -77.674799]; const space_coords = [43.09224, -77.674799];
@@ -395,9 +398,11 @@ function updateCountdown() {
countdownTo = now + 5 * 60 * 1000; countdownTo = now + 5 * 60 * 1000;
getUpdate(); getUpdate();
} }
try {
document.getElementById("countdownClock").textContent = Math.floor( document.getElementById("countdownClock").textContent = Math.floor(
countdown / 1000 countdown / 1000
); );
} catch {}
} }
async function getUpdate() { async function getUpdate() {
@@ -531,7 +536,7 @@ function getShots(nodes) {
return shots; return shots;
} }
const useLegend = window.location.pathname.replaceAll("/", "") == "hotspots" const useLegend = window.location.pathname.replaceAll("/", "") == "hotspots";
init(useLegend).then(() => { init(useLegend).then(() => {
// map.on("click", () => { // map.on("click", () => {
// shootVector(pts[2], pts[8]); // shootVector(pts[2], pts[8]);