From 2ccdc90cc5a8be2bf9c7f408cff54e8705aed89d Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 25 Jul 2022 22:55:18 -0400 Subject: [PATCH] Added an option to add callsign database URL for lookups on a map. --- htdocs/map.js | 17 +++++++++++++++-- owrx/config/defaults.py | 1 + owrx/connection.py | 1 + owrx/controllers/settings/general.py | 7 +++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/map.js b/htdocs/map.js index af879d0..9a5141f 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -37,6 +37,7 @@ $(function(){ var retention_time = 2 * 60 * 60 * 1000; var strokeOpacity = 0.8; var fillOpacity = 0.35; + var callsign_url = null; var colorKeys = {}; var colorScale = chroma.scale(['red', 'blue', 'green']).mode('hsl'); @@ -286,6 +287,9 @@ $(function(){ if ('map_position_retention_time' in config) { retention_time = config.map_position_retention_time * 1000; } + if ('callsign_url' in config) { + callsign_url = config['callsign_url']; + } break; case "update": processUpdates(json.value); @@ -340,6 +344,15 @@ $(function(){ return infowindow; } + var linkifyCallsign = function(callsign) { + if ((callsign_url == null) || (callsign_url == '')) + return callsign; + else + return '' + callsign + ''; + }; + var infowindow; var showLocatorInfoWindow = function(locator, pos) { var infowindow = getInfoWindow(); @@ -357,7 +370,7 @@ $(function(){ '