Skip to content

Commit

Permalink
Minor cleanup to generate.js
Browse files Browse the repository at this point in the history
Hopefully ends some of the invisible image concerns, at least until I replace the maps later on
  • Loading branch information
StrawberryMaster committed Sep 23, 2023
1 parent 2c6ee2f commit c9af1ad
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions static/js/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ const buttons = document.querySelectorAll(".generate");
buttons.forEach(button => {
button.addEventListener("click", () => {
const size = button.dataset.size;
const MAP_URL = size === "large"
? "static/media/bg12000.jpg"
: size === "normal"
? "static/media/bg8192.png"
: "static/media/bg8192.png";
let MAP_URL;

switch (size) {
case "large":
MAP_URL = "static/media/bg12000.jpg";
break;
case "normal":
MAP_URL = "static/media/bg8192.png";
break;
default:
MAP_URL = "static/media/bg8192.png";
break;
}

BLUE_MARBLE.src = MAP_URL;
BLUE_MARBLE.onload = () => {
Expand Down Expand Up @@ -58,7 +66,7 @@ function createMap(data, accessible) {
if (document.getElementById("smaller-dots").checked) {
DOT_SIZE = DOT_SIZE * 2.25 / 3.14;
LINE_SIZE = LINE_SIZE * 1.5 / 3.14;
}
}

let max_lat = 0;
let max_long = 0;
Expand Down

0 comments on commit c9af1ad

Please sign in to comment.