This commit is contained in:
Ian Renton
2025-10-17 09:09:38 +01:00
parent eae9d31454
commit 622fd38514

View File

@@ -1,5 +1,6 @@
// Map layers // Map layers
var markersLayer; var markersLayer;
var geodesicsLayer;
var terminator; var terminator;
// Load spots and populate the table. // Load spots and populate the table.
@@ -29,16 +30,29 @@ function buildQueryString() {
function updateMap() { function updateMap() {
// Clear existing content // Clear existing content
markersLayer.clearLayers(); markersLayer.clearLayers();
geodesicsLayer.clearLayers();
// Make new markers for all spots with a good location, not QRT, and not a duplicate spot within the data set. // Make new markers for all spots with a good location, not QRT, and not a duplicate spot within the data set.
var callsAlreadyDisplayed = []; var callsAlreadyDisplayed = [];
spots.forEach(function (s) { spots.forEach(function (s) {
if (s["dx_location_good"] && (s["qrt"] == null || s["qrt"] == false)) { if (s["dx_location_good"] && (s["qrt"] == null || s["qrt"] == false)) {
if (!callsAlreadyDisplayed.includes(s["dx_call"])) { if (!callsAlreadyDisplayed.includes(s["dx_call"])) {
// OK, create the marker // OK, create the marker
let m = L.marker([s["dx_latitude"], s["dx_longitude"]], {icon: getIcon(s)}); var 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);
// Create geodesics if required
if ($("#mapShowGeodesics")[0].checked && s["de_latitude"] != null && s["de_longitude"] != null) {
var geodesic = L.geodesic([[s["de_latitude"], s["de_longitude"]], m.getLatLng()], {
color: s["band_color"],
wrap: false,
steps: 5
});
geodesicsLayer.addLayer(geodesic);
}
} }
callsAlreadyDisplayed.push(s["dx_call"]); callsAlreadyDisplayed.push(s["dx_call"]);
} }
@@ -198,6 +212,10 @@ function setUpMap() {
markersLayer = new L.LayerGroup(); markersLayer = new L.LayerGroup();
markersLayer.addTo(map); markersLayer.addTo(map);
// Add geodesic layer
geodesicsLayer = new L.LayerGroup();
geodesicsLayer.addTo(map);
// Add terminator/greyline // Add terminator/greyline
terminator = L.terminator({ terminator = L.terminator({
interactive: false interactive: false