map.wxml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <view class="page">
  2. <view
  3. class="map-stage"
  4. catchtouchstart="handleTouchStart"
  5. catchtouchmove="handleTouchMove"
  6. catchtouchend="handleTouchEnd"
  7. catchtouchcancel="handleTouchCancel"
  8. >
  9. <view class="map-content">
  10. <canvas
  11. id="mapCanvas"
  12. type="webgl"
  13. canvas-id="mapCanvas"
  14. class="map-canvas map-canvas--base"
  15. ></canvas>
  16. </view>
  17. <view class="map-stage__crosshair"></view>
  18. <view class="map-stage__overlay">
  19. <view class="map-stage__topbar" style="padding-top: {{topInsetHeight}}px;">
  20. <view class="map-stage__meta">
  21. <view class="map-stage__eyebrow">CMR MINI MAP</view>
  22. <view class="map-stage__title">{{mapName}}</view>
  23. <view class="map-stage__badge">{{mapReadyText}}</view>
  24. </view>
  25. </view>
  26. <view class="map-stage__bottom">
  27. <view class="map-stage__status">
  28. <view class="map-stage__status-label">当前模式</view>
  29. <view class="map-stage__status-value">{{orientationModeText}}</view>
  30. <view class="map-stage__status-meta">{{gpsTrackingText}} · 缩放 {{zoom}}</view>
  31. </view>
  32. <view class="compass-widget">
  33. <view class="compass-widget__heading">{{sensorHeadingText}}</view>
  34. <view class="compass-widget__dial">
  35. <view class="compass-widget__glass"></view>
  36. <view class="compass-widget__inner-shadow"></view>
  37. <view class="compass-widget__card" style="transform: rotate({{rotationDeg}}deg);">
  38. <image class="compass-widget__north-arrow" src="../../assets/compass-north-arrow.svg" mode="aspectFit"></image>
  39. <view wx:for="{{compassTicks}}" wx:key="angle" class="compass-widget__tick-anchor" style="transform: translate(-50%, -50%) rotate({{item.angle}}deg);">
  40. <view class="compass-widget__tick {{item.long ? 'compass-widget__tick--long' : 'compass-widget__tick--short'}} {{item.major ? 'compass-widget__tick--major' : ''}}"></view>
  41. </view>
  42. <view wx:for="{{compassLabels}}" wx:key="text" class="compass-widget__mark-anchor" style="transform: translate(-50%, -50%) rotate({{item.angle}}deg);">
  43. <view class="compass-widget__mark {{item.className}}" style="transform: translate(-50%, -50%) translateY(-{{item.radius}}rpx) rotate({{item.rotateBack}}deg);">{{item.text}}</view>
  44. </view>
  45. </view>
  46. <view class="compass-widget__needle-anchor" style="transform: translate(-50%, -50%) rotate({{compassNeedleDeg}}deg);">
  47. <view class="compass-widget__needle-north"></view>
  48. <view class="compass-widget__needle-south"></view>
  49. </view>
  50. <view class="compass-widget__hub"></view>
  51. <view class="compass-widget__hub-core"></view>
  52. </view>
  53. <view class="compass-widget__hint" wx:if="{{compassDeclinationText}}">{{compassDeclinationText}}</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <cover-view class="screen-button-layer" wx:if="{{!showDebugPanel}}" style="top: {{topInsetHeight}}px;" bindtap="handleToggleDebugPanel">
  59. <cover-view class="screen-button-layer__icon">
  60. <cover-view class="screen-button-layer__line"></cover-view>
  61. <cover-view class="screen-button-layer__stand"></cover-view>
  62. </cover-view>
  63. <cover-view class="screen-button-layer__text">屏幕</cover-view>
  64. </cover-view>
  65. <view class="race-panel">
  66. <view class="race-panel__tag race-panel__tag--top-left">目标</view>
  67. <view class="race-panel__tag race-panel__tag--top-right">里程</view>
  68. <view class="race-panel__tag race-panel__tag--bottom-left">点距</view>
  69. <view class="race-panel__tag race-panel__tag--bottom-right">速度</view>
  70. <view class="race-panel__line race-panel__line--center"></view>
  71. <view class="race-panel__line race-panel__line--left-mid"></view>
  72. <view class="race-panel__line race-panel__line--right-mid"></view>
  73. <view class="race-panel__line race-panel__line--left-top"></view>
  74. <view class="race-panel__line race-panel__line--left-bottom"></view>
  75. <view class="race-panel__line race-panel__line--right-top"></view>
  76. <view class="race-panel__line race-panel__line--right-bottom"></view>
  77. <view class="race-panel__grid">
  78. <view class="race-panel__cell race-panel__cell--action">
  79. <view class="race-panel__play"></view>
  80. </view>
  81. <view class="race-panel__cell race-panel__cell--timer">
  82. <text class="race-panel__timer">{{panelTimerText}}</text>
  83. </view>
  84. <view class="race-panel__cell race-panel__cell--mileage">
  85. <view class="race-panel__mileage-wrap">
  86. <text class="race-panel__mileage">{{panelMileageText}}</text>
  87. <view class="race-panel__chevrons">
  88. <view class="race-panel__chevron"></view>
  89. <view class="race-panel__chevron race-panel__chevron--offset"></view>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="race-panel__cell race-panel__cell--distance">
  94. <view class="race-panel__metric-group race-panel__metric-group--left">
  95. <text class="race-panel__metric-value race-panel__metric-value--distance">{{panelDistanceValueText}}</text>
  96. <text class="race-panel__metric-unit race-panel__metric-unit--distance">m</text>
  97. </view>
  98. </view>
  99. <view class="race-panel__cell race-panel__cell--progress">
  100. <text class="race-panel__progress">{{panelProgressText}}</text>
  101. </view>
  102. <view class="race-panel__cell race-panel__cell--speed">
  103. <view class="race-panel__metric-group race-panel__metric-group--right">
  104. <text class="race-panel__metric-value race-panel__metric-value--speed">{{panelSpeedValueText}}</text>
  105. <text class="race-panel__metric-unit race-panel__metric-unit--speed">km/h</text>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="debug-modal" wx:if="{{showDebugPanel}}" bindtap="handleCloseDebugPanel">
  111. <view class="debug-modal__dialog" catchtap="handleDebugPanelTap">
  112. <view class="debug-modal__header">
  113. <view>
  114. <view class="debug-modal__eyebrow">DEBUG PANEL</view>
  115. <view class="debug-modal__title">地图调试信息</view>
  116. </view>
  117. <view class="debug-modal__close" bindtap="handleCloseDebugPanel">关闭</view>
  118. </view>
  119. <scroll-view class="debug-modal__content" scroll-y enhanced show-scrollbar="true">
  120. <view class="info-panel__row">
  121. <text class="info-panel__label">Build</text>
  122. <text class="info-panel__value">{{buildVersion}}</text>
  123. </view>
  124. <view class="info-panel__row info-panel__row--stack">
  125. <text class="info-panel__label">Config</text>
  126. <text class="info-panel__value">{{configStatusText}}</text>
  127. </view>
  128. <view class="info-panel__row">
  129. <text class="info-panel__label">Heading Mode</text>
  130. <text class="info-panel__value">{{orientationModeText}}</text>
  131. </view>
  132. <view class="info-panel__row">
  133. <text class="info-panel__label">Sensor Heading</text>
  134. <text class="info-panel__value">{{sensorHeadingText}}</text>
  135. </view>
  136. <view class="info-panel__row info-panel__row--stack">
  137. <text class="info-panel__label">North Ref</text>
  138. <text class="info-panel__value">{{northReferenceText}}</text>
  139. </view>
  140. <view class="info-panel__row">
  141. <text class="info-panel__label">Zoom</text>
  142. <text class="info-panel__value">{{zoom}}</text>
  143. </view>
  144. <view class="info-panel__row">
  145. <text class="info-panel__label">Rotation</text>
  146. <text class="info-panel__value">{{rotationText}}</text>
  147. </view>
  148. <view class="info-panel__row info-panel__row--stack">
  149. <text class="info-panel__label">Status</text>
  150. <text class="info-panel__value">{{statusText}}</text>
  151. </view>
  152. <view class="info-panel__row">
  153. <text class="info-panel__label">GPS</text>
  154. <text class="info-panel__value">{{gpsTrackingText}}</text>
  155. </view>
  156. <view class="info-panel__row info-panel__row--stack">
  157. <text class="info-panel__label">GPS Coord</text>
  158. <text class="info-panel__value">{{gpsCoordText}}</text>
  159. </view>
  160. <view class="info-panel__row">
  161. <text class="info-panel__label">Renderer</text>
  162. <text class="info-panel__value">{{renderMode}}</text>
  163. </view>
  164. <view class="info-panel__row info-panel__row--stack">
  165. <text class="info-panel__label">Projection</text>
  166. <text class="info-panel__value">{{projectionMode}}</text>
  167. </view>
  168. <view class="info-panel__row">
  169. <text class="info-panel__label">Auto Source</text>
  170. <text class="info-panel__value">{{autoRotateSourceText}}</text>
  171. </view>
  172. <view class="info-panel__row">
  173. <text class="info-panel__label">Calibration</text>
  174. <text class="info-panel__value">{{autoRotateCalibrationText}}</text>
  175. </view>
  176. <view class="info-panel__row info-panel__row--stack">
  177. <text class="info-panel__label">Tile URL</text>
  178. <text class="info-panel__value">{{tileSource}}</text>
  179. </view>
  180. <view class="info-panel__row">
  181. <text class="info-panel__label">Center Tile</text>
  182. <text class="info-panel__value">{{centerText}}</text>
  183. </view>
  184. <view class="info-panel__row">
  185. <text class="info-panel__label">Tile Size</text>
  186. <text class="info-panel__value">{{tileSizePx}}px</text>
  187. </view>
  188. <view class="info-panel__row">
  189. <text class="info-panel__label">Visible Tiles</text>
  190. <text class="info-panel__value">{{visibleTileCount}}</text>
  191. </view>
  192. <view class="info-panel__row">
  193. <text class="info-panel__label">Ready Tiles</text>
  194. <text class="info-panel__value">{{readyTileCount}}</text>
  195. </view>
  196. <view class="info-panel__row">
  197. <text class="info-panel__label">Memory Tiles</text>
  198. <text class="info-panel__value">{{memoryTileCount}}</text>
  199. </view>
  200. <view class="info-panel__row">
  201. <text class="info-panel__label">Disk Tiles</text>
  202. <text class="info-panel__value">{{diskTileCount}}</text>
  203. </view>
  204. <view class="info-panel__row">
  205. <text class="info-panel__label">Cache Hit</text>
  206. <text class="info-panel__value">{{cacheHitRateText}}</text>
  207. </view>
  208. <view class="info-panel__row">
  209. <text class="info-panel__label">Disk Hits</text>
  210. <text class="info-panel__value">{{diskHitCount}}</text>
  211. </view>
  212. <view class="info-panel__row">
  213. <text class="info-panel__label">Net Fetches</text>
  214. <text class="info-panel__value">{{networkFetchCount}}</text>
  215. </view>
  216. <view class="control-row">
  217. <view class="control-chip control-chip--primary" bindtap="handleRecenter">回到首屏</view>
  218. <view class="control-chip control-chip--secondary" bindtap="handleRotationReset">旋转归零</view>
  219. </view>
  220. <view class="control-row">
  221. <view class="control-chip {{gpsTracking ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleToggleGpsTracking">{{gpsTracking ? '停止定位' : '开启定位'}}</view>
  222. <view class="control-chip {{osmReferenceEnabled ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleToggleOsmReference">{{osmReferenceText}}</view>
  223. </view>
  224. <view class="control-row control-row--triple">
  225. <view class="control-chip {{orientationMode === 'manual' ? 'control-chip--active' : ''}}" bindtap="handleSetManualMode">手动</view>
  226. <view class="control-chip {{orientationMode === 'north-up' ? 'control-chip--active' : ''}}" bindtap="handleSetNorthUpMode">北朝上</view>
  227. <view class="control-chip {{orientationMode === 'heading-up' ? 'control-chip--active' : ''}}" bindtap="handleSetHeadingUpMode">朝向朝上</view>
  228. </view>
  229. <view class="control-row">
  230. <view class="control-chip control-chip--secondary" bindtap="handleCycleNorthReferenceMode">{{northReferenceButtonText}}</view>
  231. </view>
  232. <view class="control-row" wx:if="{{orientationMode === 'heading-up'}}">
  233. <view class="control-chip" bindtap="handleAutoRotateCalibrate">按当前方向校准</view>
  234. </view>
  235. <view class="control-row" wx:if="{{orientationMode === 'manual'}}">
  236. <view class="control-chip" bindtap="handleRotateStep">旋转 +15°</view>
  237. </view>
  238. </scroll-view>
  239. </view>
  240. </view>
  241. </view>