From b639fb9107ec354056d2174aacd7731f5a667325 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Wed, 7 Jan 2015 22:14:50 +0000 Subject: [PATCH] Don't display a track of "0" for aircraft with no heading data. --- public_html/script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public_html/script.js b/public_html/script.js index 0acc1ea..f46f4da 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -351,11 +351,13 @@ var TrackDirections = ["North","Northeast","East","Southeast","South","Southwest // track in degrees (0..359) function format_track_brief(track) { + if (track === null) return ""; return Math.round(track); } // track in degrees (0..359) function format_track_long(track) { + if (track === null) return ""; var trackDir = Math.floor((360 + track % 360 + 22.5) / 45) % 8; return Math.round(track) + "\u00b0 (" + TrackDirections[trackDir] + ")"; }