Skip to content

feat(map): remember map display toggles and share them across weather layers - #554

Open
PiscesXD wants to merge 1 commit into
mainfrom
feat-sqlite-map
Open

feat(map): remember map display toggles and share them across weather layers#554
PiscesXD wants to merge 1 commit into
mainfrom
feat-sqlite-map

Conversation

@PiscesXD

@PiscesXD PiscesXD commented Aug 25, 2026

Copy link
Copy Markdown
Member

摘要

地圖選單的顯示設定現在會記住了:關掉的國界、縣市界、鄉鎮界、掃描範圍、地形起伏、鄉鎮名稱或街道圖層,重開 app 後維持原樣;同時各天氣圖層共用同一組邊界與掃描範圍開關,在其中一層調整,其他圖層即時跟著變。

變更內容

💾 顯示設定持久化

  • 新增 MapReferenceOutlineControllercore/settings/):一個共享、持久化的 ChangeNotifier,管國界、縣市界、鄉鎮界、掃描範圍四個開關,寫入 map.showGlobalOutline / map.showCountyOutline / map.showTownOutline / map.showScanRange 四個 key
  • GsiOverlayController:街道圖層的 on/off 與子圖層群組選擇(map.gsiEnabled / map.gsiEnabledGroups)都持久化;防災圖層的強制開啟只影響當次進入,不會覆寫已儲存的值
  • MapScaffold:地形起伏(map.showTerrain)與鄉鎮名稱(map.showTownLabels)持久化
  • 所有 key 缺席時沿用原本預設值,舊使用者升級後行為不變
  • 容錯:儲存的群組名稱若已不存在(改名或移除)會被丟棄而非 crash,與其他 id-list 設定的既有容忍度一致

🔗 各天氣圖層共用開關

  • 原本每個 raster layer(雷達、QPESUMS、每顆衛星、每個 wind forecast 模型)各自持有一份 ValueNotifier 副本,在其中一層調整,其他層不會跟著變
  • 改由 DI(SharedDeps.mapReferenceOutline)注入同一個 controller;AdminOutlineChrome / ScanRangeOverlayChrome 改讀共享狀態,並在 attach 期間監聽——任一圖層改動,所有掛載中的圖層即時 resync

🧪 測試更新

  • 12 個測試檔案改為共用 testReferenceOutline() harness(radar / qpesums / satellite / wind forecast 圖層與選單、GSI overlay、town labels 等)

測試

  • tool/dev/test.sh test/features/map test/shared/map 全綠(423 tests passed)
  • 實機 UI 驗證:重開 app 後開關狀態維持

備註

  • 本 PR 只改變「記不記得」:所有開關的預設值維持原本狀態

@PiscesXD PiscesXD changed the title feat(map): remember the map display toggles between sessions feat(map): remember map display toggles and share them across weather layers Aug 25, 2026
New(zh-Hant): 地圖選單的顯示設定會記住了——關掉的國界、縣市界、鄉鎮界、掃描範圍、地形起伏、鄉鎮名稱或街道圖層,重開 app 後維持原樣
New(en-US): the map's display toggles — world/county/township borders, scan range, relief, township names and the street overlay — stay as you left them
New(zh-Hant): 各天氣圖層共用同一組邊界與掃描範圍開關,在其中一層調整,其他圖層即時跟著變
New(en-US): the border and scan-range toggles are shared across every weather layer, so a change on one applies to the others live
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants