[feat](trx-frontend-http): clicking APRS bar coords navigates to Map

Add window.navigateToAprsMap(lat, lon) which activates the Map tab
and pans to the given position at zoom 13. APRS bar frames that carry
a position render a clickable coordinate button that calls this
function. Button is styled inline with the frame text.

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 14:49:04 +01:00
parent 8ffe73c539
commit 37966ea29a
3 changed files with 24 additions and 1 deletions
@@ -118,7 +118,10 @@ function updateAprsBar() {
const call = `<span class="aprs-bar-call">${escapeMapHtml(pkt.srcCall)}</span>`;
const dest = escapeMapHtml(pkt.destCall || "");
const info = escapeMapHtml(pkt.info || "");
html += `<div class="aprs-bar-frame">${ts}${call}>${dest}: ${info}</div>`;
const posHtml = pkt.lat != null && pkt.lon != null
? ` <button class="aprs-bar-pos" onclick="window.navigateToAprsMap(${pkt.lat},${pkt.lon})">${pkt.lat.toFixed(4)}, ${pkt.lon.toFixed(4)}</button>`
: "";
html += `<div class="aprs-bar-frame">${ts}${call}>${dest}: ${info}${posHtml}</div>`;
}
aprsBarOverlay.innerHTML = html;
aprsBarOverlay.style.display = "flex";