From 5401e1154d078e9e7b582e1d80dd814d13479cf7 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sat, 1 Apr 2023 16:01:13 +0200 Subject: [PATCH] add URL query parameters for range rings / alt chart implements: https://github.com/wiedehopf/tar1090/pull/235 --- README-query.md | 2 ++ html/config.js | 3 +++ html/defaults.js | 2 ++ html/script.js | 10 +++++++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README-query.md b/README-query.md index 259bbfe..1f00165 100644 --- a/README-query.md +++ b/README-query.md @@ -61,6 +61,8 @@ See the main readme for more examples on how to use the filters - nowebgl - force rendering without WebGL. - tableInView - button V / only show aircraft in view in the table - screenshot - For automatic screenshotting, disables updates after the first load of all aircraft in view +- rangeRings=0,1 - 0 or 1 to enable or disable +- altitudeChart=0,1 - 0 or 1 to enable or disable - SiteLat=45.0 SiteLon=10.0 - Override the receiver location for this visit ## Toggles diff --git a/html/config.js b/html/config.js index 31fcdfd..9034fc7 100644 --- a/html/config.js +++ b/html/config.js @@ -108,6 +108,9 @@ // constant html color for markers / tracks //monochromeMarkers = "#FFFFFF"; //monochromeTracks = "#000000"; +// + +// altitudeChartDefaultState = true; // These settings control the coloring of aircraft by altitude. // All color values are given as Hue (0-359) / Saturation (0-100) / Lightness (0-100) diff --git a/html/defaults.js b/html/defaults.js index 4a93b0e..333597e 100644 --- a/html/defaults.js +++ b/html/defaults.js @@ -92,6 +92,8 @@ let outlineWidth = 1; let monochromeMarkers = null; let monochromeTracks = null; +let altitudeChartDefaultState = true; + // These settings control the coloring of aircraft by altitude. // All color values are given as Hue (0-359) / Saturation (0-100) / Lightness (0-100) let ColorByAlt = { diff --git a/html/script.js b/html/script.js index b236216..01a4670 100644 --- a/html/script.js +++ b/html/script.js @@ -775,6 +775,10 @@ function initPage() { enableLabels=true; } + if (usp.has('rangeRings')) { + SiteCircles = Boolean(parseInt(usp.get('rangeRings'))); + } + if (usp.has('limitUpdates')) { let tmp = parseInt(usp.get('limitUpdates')); if (!isNaN(tmp)) @@ -4559,11 +4563,15 @@ function invertMap(evt){ } altitudeChart.init = function () { + let chartOn = (onMobile ? false : altitudeChartDefaultState); + if (usp.has('altitudeChart')) { + chartOn = Boolean(parseInt(usp.get('altitudeChart'))); + } new Toggle({ key: "altitudeChart", display: "Altitude Chart", container: "#settingsRight", - init: (onMobile ? false : true), + init: chartOn, setState: altitudeChart.render }); }