feat: add magnetic declination north reference modes

This commit is contained in:
2026-03-20 11:40:14 +08:00
parent 714d86356d
commit 8e6291885d
4 changed files with 209 additions and 33 deletions

View File

@@ -4,7 +4,7 @@ type MapPageData = MapEngineViewState & {
showDebugPanel: boolean
}
const INTERNAL_BUILD_VERSION = 'map-build-64'
const INTERNAL_BUILD_VERSION = 'map-build-75'
let mapEngine: MapEngine | null = null
@@ -153,6 +153,12 @@ Page({
}
},
handleCycleNorthReferenceMode() {
if (mapEngine) {
mapEngine.handleCycleNorthReferenceMode()
}
},
handleAutoRotateCalibrate() {
if (mapEngine) {
mapEngine.handleAutoRotateCalibrate()

View File

@@ -42,6 +42,7 @@
<view class="compass-widget__center"></view>
</view>
<view class="compass-widget__label">{{sensorHeadingText}}</view>
<view class="compass-widget__hint" wx:if="{{compassDeclinationText}}">{{compassDeclinationText}}</view>
</view>
</view>
</view>
@@ -56,6 +57,10 @@
<text class="info-panel__label">Sensor Heading</text>
<text class="info-panel__value">{{sensorHeadingText}}</text>
</view>
<view class="info-panel__row info-panel__row--stack">
<text class="info-panel__label">North Ref</text>
<text class="info-panel__value">{{northReferenceText}}</text>
</view>
<view class="info-panel__row">
<text class="info-panel__label">Zoom</text>
<text class="info-panel__value">{{zoom}}</text>
@@ -86,10 +91,6 @@
<text class="info-panel__label">Projection</text>
<text class="info-panel__value">{{projectionMode}}</text>
</view>
<view class="info-panel__row">
<text class="info-panel__label">North Ref</text>
<text class="info-panel__value">{{northReferenceText}}</text>
</view>
<view class="info-panel__row">
<text class="info-panel__label">Auto Source</text>
<text class="info-panel__value">{{autoRotateSourceText}}</text>
@@ -149,6 +150,9 @@
<view class="control-chip {{orientationMode === 'north-up' ? 'control-chip--active' : ''}}" bindtap="handleSetNorthUpMode">北朝上</view>
<view class="control-chip {{orientationMode === 'heading-up' ? 'control-chip--active' : ''}}" bindtap="handleSetHeadingUpMode">朝向朝上</view>
</view>
<view class="control-row">
<view class="control-chip control-chip--secondary" bindtap="handleCycleNorthReferenceMode">{{northReferenceButtonText}}</view>
</view>
<view class="control-row" wx:if="{{orientationMode === 'heading-up'}}">
<view class="control-chip" bindtap="handleAutoRotateCalibrate">按当前方向校准</view>
</view>

View File

@@ -213,6 +213,15 @@
box-shadow: 0 8rpx 18rpx rgba(22, 48, 32, 0.08);
}
.compass-widget__hint {
margin-top: 8rpx;
font-size: 18rpx;
line-height: 1.4;
color: #d62828;
text-align: center;
font-weight: 700;
}
.info-panel {
flex: 1;
min-height: 0;