Skip to content

Commit 32d471b

Browse files
committed
prediction improvements
1 parent 33fa447 commit 32d471b

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

js/tracker.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,11 @@ function plotPrediction (data, dates, marker) {
780780
icon: new L.NumberedDivIcon({number: dates.indexOf(data.request.launch_datetime)+1})
781781
}).addTo(map);
782782

783+
console.log(data.request);
784+
783785
var landingTime = new Date(landingPoint.datetime);
784-
var landingTooltip = "<b>Time: </b>" + landingTime.toLocaleString();
786+
var landingTooltip = "<b>Time:</b> " + landingTime.toLocaleString() + "<br><b>Model Dataset:</b> " + data.request.dataset +
787+
"<br><b>Model Assumptions:</b><br>- " + data.request.ascent_rate + "m/s ascent<br>- " + data.request.burst_altitude + "m burst altitude<br>- " + data.request.descent_rate + "m/s descent";
785788
plot.landingMarker.bindTooltip(landingTooltip, {offset: [13,-28]});
786789
}
787790

@@ -894,9 +897,34 @@ function showLaunchSites() {
894897
if (json[key].hasOwnProperty('burst_altitude')) {
895898
burst_altitude = json[key]["burst_altitude"];
896899
}
900+
popupContent += "<br><b>Launch schedule:</b>";
901+
for (var x = 0; x < json[key]['times'].length; x++) {
902+
popupContent += "<br>- ";
903+
var day = json[key]['times'][x].split(":")[0];
904+
if (day == 0) {
905+
popupContent += "Everyday at ";
906+
} else if (day == 1) {
907+
popupContent += "Monday at ";
908+
} else if (day == 2) {
909+
popupContent += "Tuesday at ";
910+
} else if (day == 3) {
911+
popupContent += "Wednesday at ";
912+
} else if (day == 4) {
913+
popupContent += "Thursday at ";
914+
} else if (day == 5) {
915+
popupContent += "Friday at ";
916+
} else if (day == 6) {
917+
popupContent += "Saturday at ";
918+
} else if (day == 7) {
919+
popupContent += "Sunday at ";
920+
}
921+
popupContent += json[key]['times'][x].split(":")[1] + ":" + json[key]['times'][x].split(":")[2] + " UTC";
922+
}
923+
popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='https://github.com/projecthorus/sondehub-tracker/issues/114' target='_blank'>here</a>";
897924
popupContent += "<br><button onclick='launchSitePredictions(\"" + json[key]['times'].toString() + "\", \"" + latlon.toString() + "\", \"" + ascent_rate + ":" + descent_rate + ":" + burst_altitude + "\", \"" + launches.getLayerId(marker) + "\")' style='margin-bottom:0;'>Generate Predictions</button>";
898925
} else {
899926
popupContent = "<font style='font-size: 13px'>" + json[key].station_name + "</font><br><br><b>Sondes launched:</b> " + sondes;
927+
popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='https://github.com/projecthorus/sondehub-tracker/issues/114' target='_blank'>here</a>";
900928
}
901929
popup.setContent(popupContent);
902930
}

0 commit comments

Comments
 (0)