";
if (data.hasOwnProperty("humidity")) {
- html += "
";
};
if (data.hasOwnProperty("temp")) {
- html += "
";
};
if (data.hasOwnProperty("comment")) {
- html += "
"
if (data.hasOwnProperty("uploader_callsign")) {
- html += "
" + data.uploader_callsign + "
";
+ html += "
";
};
+
+
div.innerHTML = html;
+ div.getElementsByClassName("old_path_serial")[0].textContent = data.serial
+ div.getElementsByClassName("old_path_time")[0].textContent = "("+data.datetime+")"
+ div.getElementsByClassName("old_path_coords")[0].innerHTML = format_coordinates(data.lat, data.lon, data.serial)
+ div.getElementsByClassName("old_path_alt")[0].textContent = text_alt
+ div.getElementsByClassName("old_path_time_short")[0].textContent = formatDate(stringToDateUTC(data.datetime))
+ div.getElementsByClassName("old_path_time_distance")[0].textContent = distance
+ div.getElementsByClassName("old_path_duration")[0].textContent = format_time_friendly(vehicle.start_time, convert_time(vehicle.curr_position.gps_time))
+ div.getElementsByClassName("old_path_humidity")[0].textContent = data.humidity
+ div.getElementsByClassName("old_path_temp")[0].textContent = data.temp
+ div.getElementsByClassName("old_path_comment")[0].textContent = data.comment
+
+ if (data.hasOwnProperty("uploader_callsign")) {
+ div.getElementsByClassName("old_path_uploader_callsign")[0].textContent = data.uploader_callsign
+ }
+
mapInfoBox.setContent(div);
mapInfoBox.openOn(map);
@@ -2833,87 +2888,90 @@ function mapInfoBox_handle_path_new(data, vehicle, date) {
div = document.createElement('div');
html = "
";
- html += "
"+data.serial+" ("+date+")
";
+ html += "
";
html += "
";
- html += "
"+format_coordinates(data.lat, data.lon, data.serial)+"
";
+ html += "
";
var imp = offline.get('opt_imperial');
var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(data.alt)) : parseInt(data.alt)).toLocaleString("us");
- text_alt += " " + ((imp) ? 'ft':'m');
+ text_alt += " " + ((imp) ? 'ft':'m');
- html += "
Altitude: "+text_alt+"
";
- html += "
Time: "+formatDate(stringToDateUTC(date))+"
";
+ html += "
Altitude:
";
+ html += "
Time:
";
var value = vehicle.path_length;
- html += "
Distance: ";
+ html += "
Distance: ";
if(offline.get('opt_imperial')) {
- html += Math.round(value*0.000621371192) + " mi";
+ var distance = Math.round(value*0.000621371192) + " mi";
} else {
- html += Math.round(value/10)/100 + " km";
+ var distance = Math.round(value/10)/100 + " km";
}
- html += "
";
- html += "
Duration: " + format_time_friendly(vehicle.start_time, convert_time(vehicle.curr_position.gps_time)) + "
";
+ html += "
";
+ html += "
Duration:
";
- html += "
";
+ html += "
";
- if (data.hasOwnProperty("batt")) {
- html += "
Battery Voltage: " + data.batt + " V
";
- };
- if (data.hasOwnProperty("tx_frequency")) {
- html += "
TX Frequency: " + data.tx_frequency + " MHz
";
- } else if (data.hasOwnProperty("frequency")) {
- html += "
Frequency: " + data.frequency + " MHz
";
- };
- if (data.hasOwnProperty("humidity")) {
- html += "
Relative Humidity: " + data.humidity + " %
";
- };
- if (data.hasOwnProperty("manufacturer")) {
- html += "
Manufacturer: " + data.manufacturer + "
";
- };
- if (data.hasOwnProperty("pressure")) {
- html += "
Pressure: " + data.pressure + " Pa
";
- };
- if (data.hasOwnProperty("sats")) {
- html += "
Satellites: " + data.sats + "
";
- };
- if (data.hasOwnProperty("temp")) {
- html += "
Temperature External: " + data.temp + "°C
";
- };
- if (data.hasOwnProperty("subtype")) {
- html += "
Sonde Type: " + data.subtype + "
";
- } else if (data.hasOwnProperty("type")) {
- html += "
Sonde Type: " + data.type + "
";
- };
+ function prop(parent, field_name, description, unit="", fixed=undefined){
+ if (data.hasOwnProperty(field_name)){
+ var div = document.createElement("div")
+ var b = document.createElement("b")
+ b.innerText = description + ": "
+ var span = document.createElement("span")
+ var value = data[field_name];
+ if (fixed){
+ value = value.toFixed(fixed)
+ }
+ span.textContent = value + " " + unit
+ div.appendChild(b)
+ div.appendChild(span)
+ parent.appendChild(div)
+ return true
+ }
+ return false
+ }
+ var xdata_fields = document.createElement("div");
if (data.hasOwnProperty("xdata")) {
html += "
";
html += "
"
- html += "
XDATA: " + data.xdata + "
";
+ html += "
";
if (data.hasOwnProperty("pressure")) {
xdata_pressure = data.pressure;
} else {
xdata_pressure = 1100.0;
}
var tempXDATA = parseXDATA(data.xdata, xdata_pressure);
+
for (let field in tempXDATA) {
if (tempXDATA.hasOwnProperty(field)) {
+ var xdiv = document.createElement("div");
+ var xb = document.createElement("b");
+ var xs = document.createElement("span");
+ xdiv.appendChild(xb)
+ xdiv.appendChild(xs)
+ xdata_fields.appendChild(xdiv)
if (field == "xdata_instrument") {
- html += "
XDATA Instrument: " + tempXDATA.xdata_instrument.join(', ') + "
";
+ xb.textContent = "XDATA Instrument: "
+ xs.textContent = tempXDATA.xdata_instrument.join(', ')
} else {
if (globalKeys.hasOwnProperty(field)) {
if (globalSuffixes.hasOwnProperty(field)) {
- html += "
" + globalKeys[field] + ": " + tempXDATA[field] + globalSuffixes[field] + "
";
+ xb.textContent = globalKeys[field] + ": "
+ xs.textContent = tempXDATA[field] + globalSuffixes[field]
} else {
- html += "
" + globalKeys[field] + ": " + tempXDATA[field] + "
";
+ xb.textContent = globalKeys[field] + ": "
+ xs.textContent = tempXDATA[field]
}
} else {
if (globalSuffixes.hasOwnProperty(field)) {
- html += "
" + guess_name(field) + ": " + tempXDATA[field] + globalSuffixes[field] + "
";
+ xb.textContent = guess_name(field) + ": "
+ xs.textContent = tempXDATA[field] + globalSuffixes[field]
} else {
- html += "
" + guess_name(field) + ": " + tempXDATA[field] + "
";
+ xb.textContent = guess_name(field) + ": "
+ xs.textContent = tempXDATA[field]
}
}
}
@@ -2944,11 +3002,48 @@ function mapInfoBox_handle_path_new(data, vehicle, date) {
callsign_list.push(_new_call); // catch cases where there are no fields
}
- callsign_list = callsign_list.join("
");
-
- html += callsign_list + "
";
+ callsign_list = callsign_list.join("\n");
+ callsign_span = document.createElement("span")
+ callsign_span.innerText = callsign_list
div.innerHTML = html;
+ div.appendChild(callsign_span)
+
+ div.getElementsByClassName("new_path_serial")[0].textContent = data.serial
+ div.getElementsByClassName("new_path_time")[0].textContent = "("+date+")"
+
+ div.getElementsByClassName("new_path_coords")[0].innerHTML = format_coordinates(data.lat, data.lon, data.serial); // for compat we are generating safeish url in format_coordinates
+
+ div.getElementsByClassName("new_path_alt")[0].textContent = text_alt
+ div.getElementsByClassName("new_path_time_short")[0].textContent = formatDate(stringToDateUTC(date))
+
+
+ div.getElementsByClassName("new_path_time_distance")[0].textContent = distance
+
+ div.getElementsByClassName("new_path_duration")[0].textContent = format_time_friendly(vehicle.start_time, convert_time(vehicle.curr_position.gps_time))
+
+
+ var prop_parent = div.getElementsByClassName("new_path_props")[0]
+ prop(prop_parent,"batt", "Battery Voltage", "V");
+
+ if (!prop(prop_parent,"tx_frequency", "TX Frequency", "MHz", 3)){
+ prop(prop_parent,"frequency", "Frequency", "MHz", 3);
+ }
+
+
+ prop(prop_parent,"humidity", "Relative Humidity","%", 1);
+ prop(prop_parent,"manufacturer", "Manufacturer");
+ prop(prop_parent,"pressure", "Pressure", "Pa", 1);
+ prop(prop_parent,"sats", "Satellites");
+ prop(prop_parent,"temp", "Temperature External", "°C", 1);
+
+ if (!prop(prop_parent,"subtype", "Sonde Type")){
+ prop(prop_parent,"type", "Sonde Type")
+ }
+ prop(prop_parent,"xdata", "XDATA");
+ if (data.hasOwnProperty("xdata")) {
+ div.getElementsByClassName("new_path_xdata_prop")[0].appendChild(xdata_fields)
+ }
mapInfoBox.setContent(div);
mapInfoBox.openOn(map);
@@ -4424,8 +4519,10 @@ function updateCurrentPosition(lat, lon) {
} else {
currentPosition.lat = lat;
currentPosition.lon = lon;
- currentPosition.marker.addTo(map);
- currentPosition.marker.setLatLng(latlng);
+ if (!CHASE_enabled){
+ currentPosition.marker.addTo(map);
+ currentPosition.marker.setLatLng(latlng);
+ }
}
}
@@ -4675,6 +4772,13 @@ function updateRecoveryMarker(recovery) {
_recovery_icon = host_url + markers_url + "payload-not-recovered.png";
}
+ // Override icon if 'is planned' field exists and is true
+ if(recovery.hasOwnProperty('planned')){
+ if(recovery.planned == true){
+ _recovery_icon = host_url + markers_url + "payload-recovery-planned.png";
+ }
+ }
+
recoveryIcon = new L.icon({
iconUrl: _recovery_icon,
iconSize: [17, 19],
@@ -4694,23 +4798,36 @@ function updateRecoveryMarker(recovery) {
div = document.createElement('div');
+ _recovered_text = recovery.recovered ? " Recovered" : " Not Recovered";
+
+ // Override text is planned field exists and is true
+ if(recovery.hasOwnProperty('planned')){
+ if(recovery.planned == true){
+ _recovered_text = " Recovery Planned";
+ }
+ }
+
html = "
";
- html += "
"+recovery.serial+(recovery.recovered ? " Recovered" : " Not Recovered")+"
";
+ html += "
";
html += "
";
html += "
"+format_coordinates(recovery.lat, recovery.lon, recovery.serial)+"
";
- var imp = offline.get('opt_imperial');
- var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(recovery.alt)) : parseInt(recovery.alt)).toLocaleString("us");
- text_alt += " " + ((imp) ? 'ft':'m');
-
- html += "
Time: "+formatDate(stringToDateUTC(recovery.datetime))+"
";
- html += "
Reported by: "+recovery.recovered_by+"
";
- html += "
Notes: "+$('
').text(recovery.description).html()+"
";
- html += "
";
+ html += "
Time:
";
+ html += "
Reported by:
";
+ html += "
Notes:
";
+ html += "
";
html += "
";
div.innerHTML = html;
+ div.getElementsByClassName("recovery_text")[0].textContent = recovery.serial+_recovered_text
+ div.getElementsByClassName("recovery_time")[0].textContent = formatDate(stringToDateUTC(recovery.datetime))
+ div.getElementsByClassName("recovery_by")[0].textContent = recovery.recovered_by
+ div.getElementsByClassName("recovery_desc")[0].textContent = recovery.description
+ div.getElementsByClassName("recovery_path")[0].textContent = recovery.serial
+ div.getElementsByClassName("recovery_path")[0].onclick = function(){
+ showRecoveredMap(recovery.serial)
+ }
recovery.infobox.setContent(div);
@@ -4750,6 +4867,7 @@ function updateRecoveryMarker(recovery) {
recovery.recovered = r[i].recovered;
recovery.description = r[i].description;
recovery.datetime = r[i].datetime;
+ recovery.planned = r[i].planned;
recovery.fresh = true;
updateRecoveryMarker(recovery);
@@ -4803,8 +4921,17 @@ function updateRecoveryPane(r){
recoveries[r_index] = {marker: null, infobox: null};
}
+ _recovered_text = r[i].recovered ? " Recovered by " : " Not Recovered by ";
+
+ // Override text is planned field exists and is true
+ if(r[i].hasOwnProperty('planned')){
+ if(r[i].planned == true){
+ _recovered_text = " Recovery Planned by ";
+ }
+ }
+
html += "
";
- html += "
"+r[i].serial+(r[i].recovered ? " Recovered by " : " Not Recovered by ")+r[i].recovered_by+"
";
+ html += "
"+r[i].serial+(_recovered_text)+r[i].recovered_by+"
";
html += "
"+format_coordinates(lat, lon, r[i].serial)+"
";
var imp = offline.get('opt_imperial');
diff --git a/js/station.js b/js/station.js
index 74f053c..6ad8857 100644
--- a/js/station.js
+++ b/js/station.js
@@ -174,7 +174,17 @@ function drawHistorical (data, station) {
}
}
- var popup = L.popup();
+ var popup = new L.popup({ autoClose: false, closeOnClick: false }).setContent(serial);
+
+ if (!recovered) {
+ var marker = L.circleMarker([landing.lat, landing.lon], {fillColor: "white", color: iconColour, weight: 3, radius: 5, fillOpacity:1});
+ } else {
+ var marker = L.circleMarker([landing.lat, landing.lon], {fillColor: "grey", color: iconColour, weight: 3, radius: 5, fillOpacity:1});
+ }
+
+ marker.bindPopup(popup);
+
+ div = document.createElement('div');
html = "
";
html += "
"+serial+" ("+time+")
";
@@ -187,40 +197,60 @@ function drawHistorical (data, station) {
html += "
Altitude: "+text_alt+"
";
html += "
Time: "+formatDate(stringToDateUTC(time))+"
";
-
- if (landing.hasOwnProperty("type")) {
- html += "
Sonde Type: " + landing.type + "
";
- };
+ html += "
Sonde Type: Unknown
"
html += "
";
- if (recovered) {
- html += "
"+(recovery_info.recovered ? "Recovered by " : "Not Recovered by ")+recovery_info.recovered_by+"
";
- html += "
Recovery time: "+formatDate(stringToDateUTC(recovery_info.datetime))+"
";
- html += "
Recovery location: "+recovery_info.position[1]+", "+recovery_info.position[0] + "
";
- html += "
Recovery notes: "+recovery_info.description+"
";
-
- html += "
";
- }
+ html += "
";
+ html += "
";
+ html += "
Reported at:
";
+ html += "
Reported by:
";
+ html += "
Notes:
";
+ html += "
";
+ html += "
";
- html += "
";
+ html += "
";
html += "
";
html += "
"
+ html += "
"
+ html += "
";
- if (landing.hasOwnProperty("uploader_callsign")) {
- html += "
Last received by: " + landing.uploader_callsign.toLowerCase() + "
";
+ div.innerHTML = html;
+
+
+ div.getElementsByClassName("recovery_path")[0].textContent = serial
+ div.getElementsByClassName("recovery_path")[0].onclick = function(){
+ showRecoveredMap(serial)
+ }
+
+ if (landing.hasOwnProperty("type")) {
+ div.getElementsByClassName("landing_sonde_type")[0].textContent = landing.type;
};
- popup.setContent(html);
+ if (landing.hasOwnProperty("uploader_callsign")) {
+ div.getElementsByClassName("landing_uploader_callsign")[0].textContent = "Last received by: " + landing.uploader_callsign.toLowerCase();
+ };
- if (!recovered) {
- var marker = L.circleMarker([landing.lat, landing.lon], {fillColor: "white", color: iconColour, weight: 3, radius: 5, fillOpacity:1});
+ if (recovered) {
+ _recovered_text = recovery_info.recovered ? " Recovered" : "Not Recovered";
+
+ // Override text is planned field exists and is true
+ if(recovery_info.hasOwnProperty('planned')){
+ if(recovery_info.planned == true){
+ _recovered_text = " Recovery Planned";
+ }
+ }
+ div.getElementsByClassName("recovery_text")[0].textContent = recovery_info.serial + _recovered_text;
+ div.getElementsByClassName("recovery_time")[0].textContent = formatDate(stringToDateUTC(recovery_info.datetime));
+ div.getElementsByClassName("recovery_by")[0].textContent = recovery_info.recovered_by;
+ div.getElementsByClassName("recovery_desc")[0].textContent = recovery_info.description;
} else {
- var marker = L.circleMarker([landing.lat, landing.lon], {fillColor: "grey", color: iconColour, weight: 3, radius: 5, fillOpacity:1});
+ div.getElementsByClassName("recovery_section")[0].style.display = "none";
}
- marker.bindPopup(popup);
+ popup.setContent(div);
+
marker.addTo(map);
marker.bringToBack();
@@ -602,26 +632,26 @@ function launchSitePredictions(times, station, properties, marker, id) {
var date = new Date();
var time = times[i].split(":");
if (time[0] != 0) {
- date.setDate(date.getDate() + (7 + time[0] - date.getDay()) % 7);
+ date.setUTCDate(date.getUTCDate() + (7 + time[0] - date.getUTCDay()) % 7);
}
date.setUTCHours(time[1]);
date.setUTCMinutes(time[2]);
- date.setSeconds(0);
- date.setMilliseconds(0);
+ date.setUTCSeconds(0);
+ date.setUTCMilliseconds(0);
// launch time 45 minutes before target time
- date.setMinutes( date.getMinutes() - 45 );
+ date.setUTCMinutes( date.getUTCMinutes() - 45 );
while (date < now) {
if (time[0] == 0) {
- date.setDate(date.getDate() + 1);
+ date.setUTCDate(date.getUTCDate() + 1);
} else {
- date.setDate(date.getDate() + 7);
+ date.setUTCDate(date.getUTCDate() + 7);
}
}
if (day > 0) {
if (time[0] == 0) {
- date.setDate(date.getDate() + day);
+ date.setUTCDate(date.getUTCDate() + day);
} else {
- date.setDate(date.getDate() + (7*day));
+ date.setUTCDate(date.getUTCDate() + (7*day));
}
}
if (count < maxCount) {
@@ -738,15 +768,24 @@ function plotPrediction (data, dates, marker, properties) {
icon: new L.NumberedDivIcon({number: dates.indexOf(data.request.launch_datetime)+1})
}).addTo(map);
+ var coords_text = format_coordinates(landingPoint.latitude, landingLongitude, "Prediction");
+
var landingTime = new Date(landingPoint.datetime);
if (properties[3] != "" && properties[4] != "") {
var landingTooltip = "
Time: " + landingTime.toLocaleString() + "
Model Dataset: " + data.request.dataset +
+ "
Prediction: " + coords_text +
"
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 +
+ "
Prediction: " + coords_text +
"
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]});
+
+ plot.landingMarker.bindPopup(landingTooltip, { autoClose: false, closeOnClick: false })
+ .on('click', function (e) {
+ this.openPopup();
+ });
+
}
function showPrediction(url) {
@@ -917,6 +956,7 @@ function generateLaunchSites() {
}
popupContent += "
Know when this site launches? Contribute
here ";
+ popupContent += "
Site Code: " + key;
// Generate view historical button
popupContent += "
Historical ";