Skip to content

Commit 6ee7514

Browse files
smithseMark Jessopxssfox
authored andcommitted
Prediction map link and planned recovery icon (projecthorus#402)
Co-authored-by: Mark Jessop <[email protected]> Co-authored-by: xssfox <[email protected]>
1 parent dde4074 commit 6ee7514

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed
2.3 KB
Loading

js/sondehub.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,6 +4765,13 @@ function updateRecoveryMarker(recovery) {
47654765
_recovery_icon = host_url + markers_url + "payload-not-recovered.png";
47664766
}
47674767

4768+
// Override icon if 'is planned' field exists and is true
4769+
if(recovery.hasOwnProperty('planned')){
4770+
if(recovery.planned == true){
4771+
_recovery_icon = host_url + markers_url + "payload-recovery-planned.png";
4772+
}
4773+
}
4774+
47684775
recoveryIcon = new L.icon({
47694776
iconUrl: _recovery_icon,
47704777
iconSize: [17, 19],

js/station.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ function launchSitePredictions(times, station, properties, marker, id) {
705705
}
706706
}
707707

708+
//VK6DI Changes
708709
function plotPrediction (data, dates, marker, properties) {
709710
if (!launchPredictions.hasOwnProperty(marker)) {
710711
launchPredictions[marker] = {};
@@ -768,15 +769,24 @@ function plotPrediction (data, dates, marker, properties) {
768769
icon: new L.NumberedDivIcon({number: dates.indexOf(data.request.launch_datetime)+1})
769770
}).addTo(map);
770771

772+
var coords_text = format_coordinates(landingPoint.latitude, landingLongitude, "Prediction");
773+
771774
var landingTime = new Date(landingPoint.datetime);
772775
if (properties[3] != "" && properties[4] != "") {
773776
var landingTooltip = "<b>Time:</b> " + landingTime.toLocaleString() + "<br><b>Model Dataset:</b> " + data.request.dataset +
777+
"<br><b>Prediction:</b> " + coords_text +
774778
"<br><b>Model Assumptions:</b><br>- " + data.request.ascent_rate + "m/s ascent<br>- " + data.request.burst_altitude + "m burst altitude (" + properties[3] + " samples)<br>- " + data.request.descent_rate + "m/s descent (" + properties[4] + " samples)";
775779
} else {
776780
var landingTooltip = "<b>Time:</b> " + landingTime.toLocaleString() + "<br><b>Model Dataset:</b> " + data.request.dataset +
781+
"<br><b>Prediction:</b>" + coords_text +
777782
"<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";
778783
}
779-
plot.landingMarker.bindTooltip(landingTooltip, {offset: [13,-28]});
784+
785+
plot.landingMarker.bindPopup(landingTooltip, { autoClose: false, closeOnClick: false })
786+
.on('click', function (e) {
787+
this.openPopup();
788+
});
789+
780790
}
781791

782792
function showPrediction(url) {

0 commit comments

Comments
 (0)