Skip to content

Commit 9078328

Browse files
authored
Merge pull request projecthorus#106 from darksidelemm/main
Add solar elevation to float prediction popups
2 parents 5fcf4e1 + e3b4556 commit 9078328

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/tracker.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,14 +1778,18 @@ function createHysplit(callsign, adjustment, alt_color) {
17781778
vehicle.markers_hysplit[adjustment] = {};
17791779
}
17801780

1781+
// Calculate the solar elevation at this date and time.
1782+
1783+
var solar_elev_now = (SunCalc.getPosition(current_time, lat, lon, data.prediction[1].trajectory[point].altitude).altitude/rad).toFixed(1);
1784+
17811785
vehicle.markers_hysplit[adjustment][current_hours] = new L.CircleMarker(position,
17821786
{
17831787
radius: 6,
17841788
fillOpacity: 1,
17851789
color: alt_color,
17861790
}
17871791
).bindPopup(
1788-
"<B>Prediction Start Time:</B> " + startDateStr + "<BR><B>Prediction Start Altitude: </B>" + altitude + "<BR><B>Prediction Current time:</B> " + data.prediction[1].trajectory[point].datetime + " (+" + current_hours + " hrs)"
1792+
"<B>Prediction Start Time:</B> " + startDateStr + "<BR><B>Prediction Start Altitude: </B>" + altitude + "<BR><B>Prediction Current time:</B> " + data.prediction[1].trajectory[point].datetime + " (+" + current_hours + " hrs)<BR><B>Solar Elevation:</B> " + solar_elev_now + "
17891793
);
17901794

17911795
if(vehicle.prediction_hysplit_visible){

0 commit comments

Comments
 (0)