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 946ffb4..96ce31e 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 @@ -4373,6 +4373,7 @@ function navigateToTab(name, options = {}) { updateTabHistory(name, replaceHistory); } scheduleSpectrumLayout(); + if (typeof window.loadPluginsForTab === "function") window.loadPluginsForTab(name); if (name === "map") { window.trx.map?.initAprsMap(); window.trx.map?.sizeAprsMapToViewport(); diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/map-core.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/map-core.js index 2159237..9a85b74 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/map-core.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/map-core.js @@ -3424,6 +3424,16 @@ } + // Auto-init map if the map tab is already visible (e.g. direct /map navigation) + function autoInitIfVisible() { + const panel = document.getElementById("tab-map"); + if (panel && panel.style.display !== "none") { + initAprsMap(); + sizeAprsMapToViewport(); + if (aprsMap) setTimeout(() => aprsMap.invalidateSize(), 50); + } + } + // Register module API for core to call window.trx.map = { initAprsMap, @@ -3472,4 +3482,7 @@ flushDeferredDecodeMapSync, bandForHz, }; + + // If the map tab is already visible (direct /map URL), init immediately. + autoInitIfVisible(); })();