refactor: clean map page and tune heading mode

This commit is contained in:
2026-03-19 16:49:37 +08:00
parent 5fea805ac3
commit ceb5479c69
7 changed files with 89 additions and 389 deletions

View File

@@ -1,6 +1,10 @@
import { MapEngine, type MapEngineStageRect, type MapEngineViewState } from '../../engine/map/mapEngine'
const INTERNAL_BUILD_VERSION = 'map-build-58'
type MapPageData = MapEngineViewState & {
showDebugPanel: boolean
}
const INTERNAL_BUILD_VERSION = 'map-build-63'
let mapEngine: MapEngine | null = null
@@ -18,7 +22,7 @@ function getFallbackStageRect(): MapEngineStageRect {
}
Page({
data: {} as MapEngineViewState,
data: { showDebugPanel: false } as MapPageData,
onLoad() {
mapEngine = new MapEngine(INTERNAL_BUILD_VERSION, {
@@ -27,7 +31,7 @@ Page({
},
})
this.setData(mapEngine.getInitialData())
this.setData({ ...mapEngine.getInitialData(), showDebugPanel: false })
},
onReady() {
@@ -154,6 +158,12 @@ Page({
mapEngine.handleAutoRotateCalibrate()
}
},
handleToggleDebugPanel() {
this.setData({
showDebugPanel: !this.data.showDebugPanel,
})
},
})