[feat](trx-frontend): show animated radio path on APRS station click

Draw a blue dashed polyline from the receiver to the clicked APRS
station on popup open; remove it on popup close.  CSS stroke-dashoffset
animation creates a traveling-dash effect suggesting signal propagation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-01 17:50:39 +01:00
parent 6e9d0040bb
commit 1ef1da7c0d
2 changed files with 15 additions and 0 deletions
@@ -2367,6 +2367,7 @@ window.addEventListener("resize", resizeHeaderSignalCanvas);
let aprsMap = null;
let aprsMapBaseLayer = null;
let aprsMapReceiverMarker = null;
let aprsRadioPath = null;
const stationMarkers = new Map();
const locatorMarkers = new Map();
const mapMarkers = new Set();
@@ -2423,13 +2424,25 @@ function initAprsMap() {
}
// Rebuild APRS popup content on open so age and distance are always fresh
// and draw an animated radio path from receiver to the station
aprsMap.on("popupopen", function(e) {
const marker = e.popup._source;
if (aprsRadioPath) { aprsRadioPath.remove(); aprsRadioPath = null; }
if (!marker || !marker._aprsCall) return;
const entry = stationMarkers.get(marker._aprsCall);
if (!entry) return;
const ll = marker.getLatLng();
e.popup.setContent(buildAprsPopupHtml(marker._aprsCall, ll.lat, ll.lng, entry.info || "", entry.pkt));
if (serverLat != null && serverLon != null) {
aprsRadioPath = L.polyline(
[[serverLat, serverLon], [ll.lat, ll.lng]],
{ className: "aprs-radio-path", color: "#3388ff", weight: 2, opacity: 0.85, interactive: false }
).addTo(aprsMap);
}
});
aprsMap.on("popupclose", function() {
if (aprsRadioPath) { aprsRadioPath.remove(); aprsRadioPath = null; }
});
// Materialise any stations that were buffered before the map was ready