From 4cbb1ab43795c64ccc2748d4cb4ebede98a3797b Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 24 Jan 2017 18:10:06 -0600 Subject: [PATCH] Round range rings labels. Add commas to altitudes. Change Track to Heading and add degree symbol. Remove the work Link from links --- public_html/formatter.js | 16 ++++++++++------ public_html/index.html | 8 ++++---- public_html/script.js | 4 ++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/public_html/formatter.js b/public_html/formatter.js index 8d6dca9..d25460b 100644 --- a/public_html/formatter.js +++ b/public_html/formatter.js @@ -6,7 +6,7 @@ var DEGREES='\u00b0' var UP_TRIANGLE='\u25b2'; // U+25B2 BLACK UP-POINTING TRIANGLE var DOWN_TRIANGLE='\u25bc'; // U+25BC BLACK DOWN-POINTING TRIANGLE -var TrackDirections = ["North","Northeast","East","Southeast","South","Southwest","West","Northwest"]; +var TrackDirections = ["North","NE","East","SE","South","SW","West","NW"]; var UnitLabels = { 'altitude': { metric: "m", imperial: "ft", nautical: "ft"}, @@ -31,7 +31,7 @@ function format_track_brief(track) { return ""; } - return Math.round(track); + return Math.round(track) + DEGREES; } // track in degrees (0..359) @@ -54,7 +54,7 @@ function format_altitude_brief(alt, vr, displayUnits) { return "ground"; } - alt_text = Math.round(convert_altitude(alt, displayUnits)) + NBSP; + alt_text = Math.round(convert_altitude(alt, displayUnits)).toLocaleString() + NBSP; // Vertical Rate Triangle var verticalRateTriangle = ""; @@ -80,7 +80,7 @@ function format_altitude_long(alt, vr, displayUnits) { return "on ground"; } - alt_text = Math.round(convert_altitude(alt, displayUnits)) + NBSP + get_unit_label("altitude", displayUnits); + alt_text = Math.round(convert_altitude(alt, displayUnits)).toLocaleString() + NBSP + get_unit_label("altitude", displayUnits); if (vr > 128) { return UP_TRIANGLE + NBSP + alt_text; @@ -142,12 +142,16 @@ function format_distance_brief(dist, displayUnits) { } // dist in meters -function format_distance_long(dist, displayUnits) { +function format_distance_long(dist, displayUnits, fixed) { if (dist === null) { return "n/a"; } - var dist_text = convert_distance(dist, displayUnits).toFixed(1) + NBSP + get_unit_label("distance", displayUnits); + if (typeof fixed === 'undefined') { + fixed = 1; + } + + var dist_text = convert_distance(dist, displayUnits).toFixed(fixed) + NBSP + get_unit_label("distance", displayUnits); return dist_text; } diff --git a/public_html/index.html b/public_html/index.html index e5e9d6d..fb0c5a1 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -171,7 +171,7 @@ - AirFrames.org Link + AirFrames.org @@ -310,15 +310,15 @@ Speed () Vertical Rate () Distance () - Track + Heading Msgs Age RSSI Latitude Longitude Data Source - Airframes.org Link - FlightAware Link + Airframes.org + FlightAware Photos diff --git a/public_html/script.js b/public_html/script.js index 840d601..ed2d4f4 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -692,7 +692,7 @@ function createSiteCircleFeatures() { font: '10px Helvetica Neue, sans-serif', fill: new ol.style.Fill({ color: '#000' }), offsetY: -8, - text: format_distance_long(distance, DisplayUnits) + text: format_distance_long(distance, DisplayUnits, 0) }) }); @@ -802,7 +802,7 @@ function refreshSelected() { } else { $('#selected_callsign').text('n/a'); } - $('#selected_flightaware_link').html(getFlightAwareModeSLink(selected.icao, selected.flight, "FlightAware.com Link")); + $('#selected_flightaware_link').html(getFlightAwareModeSLink(selected.icao, selected.flight, "FlightAware.com")); if (selected.registration !== null) { $('#selected_registration').text(selected.registration);