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,12 +29,18 @@ 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)) {
let m = L.marker([s["dx_latitude"], s["dx_longitude"]], {icon: getIcon(s)}); if (!callsAlreadyDisplayed.includes(s["dx_call"])) {
m.bindPopup(getTooltipText(s)); // OK, create the marker
markersLayer.addLayer(m); 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"]);
} }
}); });
} }