From 87119c33e10eed68a71013d7713c822d6d9067f9 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 13 Apr 2026 09:41:58 -0500 Subject: [PATCH] Refresh viewshed on band change when a point is selected --- assets/js/propagation_map_hook.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assets/js/propagation_map_hook.ts b/assets/js/propagation_map_hook.ts index 1154f638..6382d747 100644 --- a/assets/js/propagation_map_hook.ts +++ b/assets/js/propagation_map_hook.ts @@ -727,6 +727,17 @@ export const PropagationMap: Record & { this.handleEvent("update_band_info", ({ band_info }: { band_info: BandInfo }) => { this.bandInfo = band_info + + // Viewshed depends on freq + score-derived range, so recompute it when + // the band changes if a point is still selected. update_scores already + // handles the heatmap, reach polygon, and detail panel refresh. + if (this.clickedLatLng && this.detailPanel && this.detailPanel.style.display !== "none") { + this.viewshedLoading = true + this.pushEvent("compute_viewshed", { + lat: this.clickedLatLng[0], + lon: this.clickedLatLng[1] + }) + } }) // Prevent control panel / sidebar from eating map clicks/scrolls