refactor: clean map page and tune heading mode
This commit is contained in:
@@ -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,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user