diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js index e4a579c..19255e5 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js @@ -839,9 +839,10 @@ const mapMarkers = new Set(); const mapFilter = { aprs: true, ft8: true }; function initAprsMap() { - if (aprsMap) return; const mapEl = document.getElementById("aprs-map"); if (!mapEl) return; + sizeAprsMapToViewport(); + if (aprsMap) return; const hasLocation = serverLat != null && serverLon != null; const center = hasLocation ? [serverLat, serverLon] : [20, 0]; @@ -876,6 +877,16 @@ function initAprsMap() { } } +function sizeAprsMapToViewport() { + const mapEl = document.getElementById("aprs-map"); + if (!mapEl) return; + const topPadding = parseFloat(getComputedStyle(document.body).paddingTop) || 0; + const available = Math.max(0, window.innerHeight - topPadding); + const target = Math.max(150, Math.floor(available * 0.6)); + mapEl.style.height = `${target}px`; + if (aprsMap) aprsMap.invalidateSize(); +} + function aprsSymbolIcon(symbolTable, symbolCode) { if (!symbolTable || !symbolCode) return null; const sheet = symbolTable === "/" ? 0 : 1; @@ -985,11 +996,18 @@ document.querySelectorAll(".sub-tab-bar").forEach((bar) => { parent.querySelector(`#subtab-${btn.dataset.subtab}`).style.display = ""; if (btn.dataset.subtab === "map") { initAprsMap(); + sizeAprsMapToViewport(); if (aprsMap) setTimeout(() => aprsMap.invalidateSize(), 50); } }); }); +window.addEventListener("resize", () => { + const mapTab = document.getElementById("subtab-map"); + if (!mapTab || mapTab.style.display === "none") return; + sizeAprsMapToViewport(); +}); + // --- Signal measurement --- const sigMeasureBtn = document.getElementById("sig-measure-btn"); const sigClearBtn = document.getElementById("sig-clear-btn"); diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html index 331a467..6c2b0f7 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html @@ -61,7 +61,7 @@ -