diff --git a/js/tracker.js b/js/tracker.js
index 4b89ab9..4960c2c 100644
--- a/js/tracker.js
+++ b/js/tracker.js
@@ -710,7 +710,7 @@ function launchSitePredictions(times, station, properties, marker) {
}
function handleData(data) {
completed += 1;
- plotPrediction(data, dates, marker);
+ plotPrediction(data, dates, marker, properties);
if (completed == dates.length) {
popupContent += "";
popup.setContent(popupContent);
@@ -725,7 +725,7 @@ function launchSitePredictions(times, station, properties, marker) {
}
}
-function plotPrediction (data, dates, marker) {
+function plotPrediction (data, dates, marker, properties) {
if (!launchPredictions.hasOwnProperty(marker)) {
launchPredictions[marker] = {};
}
@@ -789,8 +789,13 @@ function plotPrediction (data, dates, marker) {
}).addTo(map);
var landingTime = new Date(landingPoint.datetime);
- var landingTooltip = "Time: " + landingTime.toLocaleString() + "
Model Dataset: " + data.request.dataset +
- "
Model Assumptions:
- " + data.request.ascent_rate + "m/s ascent
- " + data.request.burst_altitude + "m burst altitude
- " + data.request.descent_rate + "m/s descent";
+ if (properties[3] != "" && properties[4] != "") {
+ var landingTooltip = "Time: " + landingTime.toLocaleString() + "
Model Dataset: " + data.request.dataset +
+ "
Model Assumptions:
- " + data.request.ascent_rate + "m/s ascent
- " + data.request.burst_altitude + "m burst altitude (" + properties[3] + " samples)
- " + data.request.descent_rate + "m/s descent (" + properties[4] + " samples)";
+ } else {
+ var landingTooltip = "Time: " + landingTime.toLocaleString() + "
Model Dataset: " + data.request.dataset +
+ "
Model Assumptions:
- " + data.request.ascent_rate + "m/s ascent
- " + data.request.burst_altitude + "m burst altitude
- " + data.request.descent_rate + "m/s descent";
+ }
plot.landingMarker.bindTooltip(landingTooltip, {offset: [13,-28]});
}
@@ -860,6 +865,8 @@ function showLaunchSites() {
var ascent_rate = 5;
var descent_rate = 6;
var burst_altitude = 26000;
+ var burst_samples = "";
+ var descent_samples = "";
if (json[key].rs_types.includes("11") || json[key].rs_types.includes("82")) { //LMS6
ascent_rate = 5;
descent_rate = 2.5;
@@ -874,6 +881,12 @@ function showLaunchSites() {
if (json[key].hasOwnProperty('burst_altitude')) {
burst_altitude = json[key]["burst_altitude"];
}
+ if (json[key].hasOwnProperty('burst_samples')) {
+ burst_samples = json[key]["burst_samples"];
+ }
+ if (json[key].hasOwnProperty('descent_samples')) {
+ descent_samples = json[key]["descent_samples"];
+ }
popupContent += "
Launch schedule:";
for (var x = 0; x < json[key]['times'].length; x++) {
popupContent += "
- ";
@@ -901,7 +914,7 @@ function showLaunchSites() {
popupContent += "
Notes: " + json[key]["notes"];
}
popupContent += "
Know when this site launches? Contribute here";
- popupContent += "
";
+ popupContent += "
";
} else {
popupContent = "" + json[key].station_name + "
Sondes launched: " + sondesList;
popupContent += "
Know when this site launches? Contribute here";