From 27a19597a982c955eebfe3ee07fc719c8cb72c95 Mon Sep 17 00:00:00 2001 From: tuffnerdstuff Date: Fri, 2 Apr 2021 12:04:34 +0200 Subject: [PATCH] Displaying metrics is optional --- backend-php/dynamic.js.php | 2 ++ backend-php/include/config-sample.php | 6 ++++++ backend-php/include/inc.php | 2 ++ frontend/main.js | 4 +++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/backend-php/dynamic.js.php b/backend-php/dynamic.js.php index 34a25e4..47e2867 100644 --- a/backend-php/dynamic.js.php +++ b/backend-php/dynamic.js.php @@ -16,5 +16,7 @@ var VELOCITY_DELTA_TIME = var TRAIL_COLOR = ; var VELOCITY_UNIT = ; var ALTITUDE_UNIT = ; +var SHOW_VELOCITY = ; +var SHOW_ALTITUDE_AMSL = ; var OFFLINE_TIMEOUT = ; var REQUEST_TIMEOUT = ; diff --git a/backend-php/include/config-sample.php b/backend-php/include/config-sample.php index 466c398..9186369 100644 --- a/backend-php/include/config-sample.php +++ b/backend-php/include/config-sample.php @@ -278,6 +278,12 @@ // METERS, FEET "altitude_unit" => METERS, +// Display velocity below marker +"show_velocity" => true, + +// Display altitude AMSL below marker +"show_altitude_amsl"=> true, + // The publicly accessible URL to reach Hauk, with trailing slash. "public_url" => 'https://example.com/' diff --git a/backend-php/include/inc.php b/backend-php/include/inc.php index f423828..9465ead 100644 --- a/backend-php/include/inc.php +++ b/backend-php/include/inc.php @@ -160,6 +160,8 @@ const DEFAULTS = array( "trail_color" => '#d80037', "velocity_unit" => KILOMETERS_PER_HOUR, "altitude_unit" => METERS, + "show_velocity" => true, + "show_altitude_amsl" => true, "public_url" => 'https://example.com/' ); diff --git a/frontend/main.js b/frontend/main.js index cf8b08c..394d33c 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -711,11 +711,13 @@ function processUpdate(data, init) { '
' + '

' + '' + - '' + + '' + 'vel:' + '0.0 ' + VELOCITY_UNIT.unit + '' + '
' + + '
' + + '' + 'alt:' + '0.0 ' + ALTITUDE_UNIT.unit + '' +