From 7d66db5b5052de4e2f9dd6677d9b9f0646b94291 Mon Sep 17 00:00:00 2001 From: Tag Date: Thu, 7 Jan 2021 15:54:27 -0800 Subject: [PATCH] remote station distance and azimuth in lookup if available --- package.nw/lib/gt.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package.nw/lib/gt.js b/package.nw/lib/gt.js index 7e8dc71..ba4a6a9 100644 --- a/package.nw/lib/gt.js +++ b/package.nw/lib/gt.js @@ -15008,6 +15008,20 @@ function displayLookupObject(lookup, gridPass, fromCache = false) worker += makeRow("County", lookup, "county"); worker += makeRow("Latitude", lookup, "lat"); worker += makeRow("Longitude", lookup, "lon"); + if ( getLookProp(lookup, "lat").length > 0 && getLookProp(lookup, "lon").length > 0 ) + { + worker += "Distance" + + parseInt( + MyCircle.distance( + g_myLat, + g_myLon, + Number(lookup["lat"]), Number(lookup["lon"]), + distanceUnit.value + ) * MyCircle.validateRadius(distanceUnit.value) + ) + distanceUnit.value.toLowerCase() + ""; + let bearing = parseInt( MyCircle.bearing( g_myLat, g_myLon, Number(lookup["lat"]), Number(lookup["lon"]) ) ); + worker += "Azimuth" + bearing + "°"; + } worker += makeRow("Grid", lookup, "grid", true); if ( getLookProp(lookup, "gtGrid").length > 0 &&