[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:
@@ -2469,6 +2469,24 @@ function aprsSymbolIcon(symbolTable, symbolCode) {
|
||||
});
|
||||
}
|
||||
|
||||
window.navigateToAprsMap = function(lat, lon) {
|
||||
// Activate the map tab
|
||||
document.querySelectorAll(".tab-bar .tab").forEach((t) => t.classList.remove("active"));
|
||||
const mapTabBtn = document.querySelector(".tab-bar .tab[data-tab='map']");
|
||||
if (mapTabBtn) mapTabBtn.classList.add("active");
|
||||
document.querySelectorAll(".tab-panel").forEach((p) => (p.style.display = "none"));
|
||||
const mapPanel = document.getElementById("tab-map");
|
||||
if (mapPanel) mapPanel.style.display = "";
|
||||
initAprsMap();
|
||||
sizeAprsMapToViewport();
|
||||
if (aprsMap) {
|
||||
setTimeout(() => {
|
||||
aprsMap.invalidateSize();
|
||||
aprsMap.setView([lat, lon], 13);
|
||||
}, 50);
|
||||
}
|
||||
};
|
||||
|
||||
window.aprsMapAddStation = function(call, lat, lon, info, symbolTable, symbolCode) {
|
||||
if (!aprsMap) initAprsMap();
|
||||
if (!aprsMap) return;
|
||||
|
||||
Reference in New Issue
Block a user