Bug fixes and performance improvements

This commit is contained in:
Ian Renton
2026-05-10 10:57:41 +01:00
parent 74ce486098
commit 363735a235
25 changed files with 82 additions and 66 deletions

View File

@@ -103,7 +103,11 @@ function addSpot() {
// Show an "add spot" error.
function showAddSpotError(text) {
$("#result-bad").html("<div class='alert alert-danger alert-dismissible fade show mb-0 mt-4' role='alert'><i class='fa-solid fa-triangle-exclamation'></i> " + text + "<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button></div>");
var div = $("<div class='alert alert-danger alert-dismissible fade show mb-0 mt-4' role='alert'></div>");
div.append("<i class='fa-solid fa-triangle-exclamation'></i> ");
div.append(document.createTextNode(text));
div.append("<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>");
$("#result-bad").empty().append(div);
}
// Force callsign and mode capitalisation

View File

@@ -219,9 +219,9 @@ function addAlertRowsToTable(tbody, alerts) {
var items = []
for (var i = 0; i < a["sig_refs"].length; i++) {
if (a["sig_refs"][i]["url"] != null) {
items[i] = `<a href='${a["sig_refs"][i]["url"]}' title='${a["sig_refs"][i]["name"]}' target='_new' class='sig-ref-link'>${a["sig_refs"][i]["id"]}</a>`
items[i] = `<a href='${encodeURI(a["sig_refs"][i]["url"])}' title='${escapeHtml(a["sig_refs"][i]["name"])}' target='_new' class='sig-ref-link'>${escapeHtml(a["sig_refs"][i]["id"])}</a>`
} else {
items[i] = `${a["sig_refs"][i]["id"]}`
items[i] = `${escapeHtml(a["sig_refs"][i]["id"])}`
}
}
sig_refs = items.join(", ");

View File

@@ -15,6 +15,7 @@ const WAB_WAI_GRID_COLOR_DARK = 'rgba(60, 60, 120, 1.0)';
var backgroundTileLayer;
var markersLayer;
var geodesicsLayer;
var oms;
var terminator;
var maidenheadGrid;
var cqZones;
@@ -48,7 +49,7 @@ function buildQueryString() {
});
str = str + "max_age=" + $("#max-spot-age option:selected").val();
// Additional filters for the map view: No dupes, no QRT, only spots with good locations
str = str + "&dedupe=true&allow_qrt=false&needs_good_location=true";
str = str + "&dedupe=true&allow_qrt=false";
str = str + getCredentialQueryString();
return str;
}
@@ -58,12 +59,14 @@ function updateMap() {
// Clear existing content
markersLayer.clearLayers();
geodesicsLayer.clearLayers();
oms.clearMarkers();
// Make new markers for all spots that match the filter
spots.forEach(function (s) {
var m = L.marker([s["dx_latitude"], s["dx_longitude"]], {icon: getIcon(s)});
m.bindPopup(getTooltipText(s));
markersLayer.addLayer(m);
oms.addMarker(m);
// Create geodesics if required
if ($("#mapShowGeodesics")[0].checked && s["de_latitude"] != null && s["de_longitude"] != null) {
@@ -414,6 +417,12 @@ function setUpMap() {
markersLayer = new L.LayerGroup();
markersLayer.addTo(map);
// Set up spiderfy for overlapping markers
oms = new OverlappingMarkerSpiderfier(map, {keepSpiderfied: true});
oms.addListener('click', function(marker) {
marker.openPopup();
});
// Add geodesic layer
geodesicsLayer = new L.LayerGroup();
geodesicsLayer.addTo(map);

View File

@@ -290,9 +290,9 @@ function createNewTableRowsForSpot(s, highlightNew) {
var items = []
for (var i = 0; i < s["sig_refs"].length; i++) {
if (s["sig_refs"][i]["url"] != null) {
items[i] = `<span style="white-space: nowrap;"><a href='${s["sig_refs"][i]["url"]}' title='${s["sig_refs"][i]["name"]}' target='_new' class='sig-ref-link'>${s["sig_refs"][i]["id"]}</a></span>`
items[i] = `<span style="white-space: nowrap;"><a href='${encodeURI(s["sig_refs"][i]["url"])}' title='${escapeHtml(s["sig_refs"][i]["name"])}' target='_new' class='sig-ref-link'>${escapeHtml(s["sig_refs"][i]["id"])}</a></span>`
} else {
items[i] = `<span style="white-space: nowrap;">${s["sig_refs"][i]["id"]}</span>`
items[i] = `<span style="white-space: nowrap;">${escapeHtml(s["sig_refs"][i]["id"])}</span>`
}
}
sig_refs = items.join(", ");