[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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user