feat: add background gps tracking support
This commit is contained in:
@@ -5,7 +5,7 @@ type MapPageData = MapEngineViewState & {
|
||||
showDebugPanel: boolean
|
||||
}
|
||||
|
||||
const INTERNAL_BUILD_VERSION = 'map-build-82'
|
||||
const INTERNAL_BUILD_VERSION = 'map-build-88'
|
||||
const REMOTE_GAME_CONFIG_URL = 'https://oss-mbh5.colormaprun.com/wxmini/test/qyds-001/game.json'
|
||||
|
||||
let mapEngine: MapEngine | null = null
|
||||
@@ -195,6 +195,12 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
handleToggleGpsTracking() {
|
||||
if (mapEngine) {
|
||||
mapEngine.handleToggleGpsTracking()
|
||||
}
|
||||
},
|
||||
|
||||
handleToggleDebugPanel() {
|
||||
this.setData({
|
||||
showDebugPanel: !this.data.showDebugPanel,
|
||||
@@ -221,6 +227,13 @@ Page({
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -81,6 +81,14 @@
|
||||
<text class="info-panel__label">Status</text>
|
||||
<text class="info-panel__value">{{statusText}}</text>
|
||||
</view>
|
||||
<view class="info-panel__row">
|
||||
<text class="info-panel__label">GPS</text>
|
||||
<text class="info-panel__value">{{gpsTrackingText}}</text>
|
||||
</view>
|
||||
<view class="info-panel__row info-panel__row--stack">
|
||||
<text class="info-panel__label">GPS Coord</text>
|
||||
<text class="info-panel__value">{{gpsCoordText}}</text>
|
||||
</view>
|
||||
<view class="control-row">
|
||||
<view class="control-chip control-chip--secondary" bindtap="handleToggleDebugPanel">{{showDebugPanel ? '隐藏调试' : '查看调试'}}</view>
|
||||
</view>
|
||||
@@ -148,6 +156,9 @@
|
||||
<view class="control-chip control-chip--primary" bindtap="handleRecenter">回到首屏</view>
|
||||
<view class="control-chip control-chip--secondary" bindtap="handleRotationReset">旋转归零</view>
|
||||
</view>
|
||||
<view class="control-row">
|
||||
<view class="control-chip {{gpsTracking ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleToggleGpsTracking">{{gpsTracking ? '停止定位' : '开启定位'}}</view>
|
||||
</view>
|
||||
<view class="control-row control-row--triple">
|
||||
<view class="control-chip {{orientationMode === 'manual' ? 'control-chip--active' : ''}}" bindtap="handleSetManualMode">手动</view>
|
||||
<view class="control-chip {{orientationMode === 'north-up' ? 'control-chip--active' : ''}}" bindtap="handleSetNorthUpMode">北朝上</view>
|
||||
@@ -166,3 +177,4 @@
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user