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"]); } }); }