From eae9d314549e7afc674988604bae5478b189eb0b Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Fri, 17 Oct 2025 08:57:59 +0100 Subject: [PATCH] Filter out QRT and repeats #42 --- webassets/js/map.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/webassets/js/map.js b/webassets/js/map.js index b4923b8..367df35 100644 --- a/webassets/js/map.js +++ b/webassets/js/map.js @@ -29,12 +29,18 @@ function buildQueryString() { function updateMap() { // Clear existing content markersLayer.clearLayers(); - // Make new markers for all spots with a good location + + // Make new markers for all spots with a good location, not QRT, and not a duplicate spot within the data set. + var callsAlreadyDisplayed = []; spots.forEach(function (s) { - if (s["dx_location_good"]) { - let m = L.marker([s["dx_latitude"], s["dx_longitude"]], {icon: getIcon(s)}); - m.bindPopup(getTooltipText(s)); - markersLayer.addLayer(m); + if (s["dx_location_good"] && (s["qrt"] == null || s["qrt"] == false)) { + if (!callsAlreadyDisplayed.includes(s["dx_call"])) { + // OK, create the marker + let m = L.marker([s["dx_latitude"], s["dx_longitude"]], {icon: getIcon(s)}); + m.bindPopup(getTooltipText(s)); + markersLayer.addLayer(m); + } + callsAlreadyDisplayed.push(s["dx_call"]); } }); }