mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Filter out QRT and repeats #42
This commit is contained in:
@@ -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"]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user