Filter out QRT and repeats #42

This commit is contained in:
Ian Renton
2025-10-17 08:57:59 +01:00
parent c545a73e93
commit eae9d31454

View File

@@ -29,13 +29,19 @@ function buildQueryString() {
function updateMap() { function updateMap() {
// Clear existing content // Clear existing content
markersLayer.clearLayers(); 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) { spots.forEach(function (s) {
if (s["dx_location_good"]) { 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)}); let m = L.marker([s["dx_latitude"], s["dx_longitude"]], {icon: getIcon(s)});
m.bindPopup(getTooltipText(s)); m.bindPopup(getTooltipText(s));
markersLayer.addLayer(m); markersLayer.addLayer(m);
} }
callsAlreadyDisplayed.push(s["dx_call"]);
}
}); });
} }