map.wxml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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__bottom">
  20. <view class="compass-widget">
  21. <view class="compass-widget__heading">{{sensorHeadingText}}</view>
  22. <view class="compass-widget__edge-arrow"></view>
  23. <view class="compass-widget__dial {{orientationMode === 'heading-up' ? 'compass-widget__dial--active' : ''}}">
  24. <view class="compass-widget__glass"></view>
  25. <view class="compass-widget__inner-shadow"></view>
  26. <view class="compass-widget__card" style="transform: rotate({{rotationDeg}}deg);">
  27. <image class="compass-widget__north-arrow" src="../../assets/compass-north-arrow.svg" mode="aspectFit"></image>
  28. <view wx:for="{{compassTicks}}" wx:key="angle" class="compass-widget__tick-anchor" style="transform: translate(-50%, -50%) rotate({{item.angle}}deg);">
  29. <view class="compass-widget__tick {{item.long ? 'compass-widget__tick--long' : 'compass-widget__tick--short'}} {{item.major ? 'compass-widget__tick--major' : ''}}"></view>
  30. </view>
  31. <view wx:for="{{compassLabels}}" wx:key="text" class="compass-widget__mark-anchor" style="transform: translate(-50%, -50%) rotate({{item.angle}}deg);">
  32. <view class="compass-widget__mark {{item.className}}" style="transform: translate(-50%, -50%) translateY(-{{item.radius}}rpx) rotate({{item.rotateBack}}deg);">{{item.text}}</view>
  33. </view>
  34. </view>
  35. <view class="compass-widget__needle-anchor" style="transform: translate(-50%, -50%) rotate({{compassNeedleDeg}}deg);">
  36. <view class="compass-widget__needle-north"></view>
  37. <view class="compass-widget__needle-south"></view>
  38. </view>
  39. <view class="compass-widget__hub"></view>
  40. <view class="compass-widget__hub-core"></view>
  41. </view>
  42. <view class="compass-widget__hint" wx:if="{{compassDeclinationText}}">{{compassDeclinationText}}</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <cover-view class="map-side-toggle" wx:if="{{!showDebugPanel}}" style="top: {{topInsetHeight}}px;" bindtap="handleCycleSideButtons">
  48. <cover-view class="map-side-button map-side-button--icon">
  49. <cover-image wx:if="{{sideButtonMode === 'left'}}" class="map-side-button__image" src="../../assets/btn_more2.png"></cover-image>
  50. <cover-image wx:elif="{{sideButtonMode === 'hidden'}}" class="map-side-button__image" src="../../assets/btn_more1.png"></cover-image>
  51. <cover-image wx:else class="map-side-button__image" src="../../assets/btn_more3.png"></cover-image>
  52. </cover-view>
  53. </cover-view>
  54. <cover-view class="map-side-column map-side-column--left map-side-column--left-group" wx:if="{{!showDebugPanel && showLeftButtonGroup}}" style="top: {{topInsetHeight}}px;">
  55. <cover-view class="map-side-button map-side-button--icon" bindtap="handleToggleMapRotateMode"><cover-image class="map-side-button__rotate-image {{orientationMode === 'heading-up' ? 'map-side-button__rotate-image--active' : ''}}" src="../../assets/btn_map_rotate_cropped.png"></cover-image></cover-view>
  56. <cover-view class="map-side-button map-side-button--muted"><cover-view class="map-side-button__text">LOC</cover-view></cover-view>
  57. <cover-view class="map-side-button"><cover-view class="map-side-button__text">LOCK</cover-view></cover-view>
  58. <cover-view class="map-side-button map-side-button--active"><cover-view class="map-side-button__text">SUN</cover-view></cover-view>
  59. <cover-view class="map-side-button"><cover-view class="map-side-button__text">EXIT</cover-view></cover-view>
  60. </cover-view>
  61. <cover-view class="map-side-column map-side-column--right-main" wx:if="{{!showDebugPanel && showRightButtonGroups}}" style="top: {{topInsetHeight}}px;">
  62. <cover-view class="map-side-button"><cover-view class="map-side-button__text">N</cover-view></cover-view>
  63. <cover-view class="map-side-button map-side-button--active"><cover-view class="map-side-button__text">DIR</cover-view></cover-view>
  64. <cover-view class="map-side-button"><cover-view class="map-side-button__text">COMP</cover-view></cover-view>
  65. <cover-view class="map-side-button map-side-button--active"><cover-view class="map-side-button__text">GUIDE</cover-view></cover-view>
  66. <cover-view class="map-side-button map-side-button--muted"><cover-view class="map-side-button__text">NET</cover-view></cover-view>
  67. <cover-view class="map-side-button map-side-button--active"><cover-view class="map-side-button__text">GO</cover-view></cover-view>
  68. </cover-view>
  69. <cover-view class="map-side-column map-side-column--right-sub" wx:if="{{!showDebugPanel && showRightButtonGroups}}" style="top: {{topInsetHeight}}px;">
  70. <cover-view class="map-side-button"><cover-view class="map-side-button__text">INFO</cover-view></cover-view>
  71. <cover-view class="map-side-button"><cover-view class="map-side-button__text">SET</cover-view></cover-view>
  72. <cover-view class="map-side-button"><cover-view class="map-side-button__text">m</cover-view></cover-view>
  73. <cover-view class="map-side-button"><cover-view class="map-side-button__text">PIN</cover-view></cover-view>
  74. <cover-view class="map-side-button"><cover-view class="map-side-button__text">LIST</cover-view></cover-view>
  75. <cover-view class="map-side-button"><cover-view class="map-side-button__text">USER</cover-view></cover-view>
  76. </cover-view>
  77. <cover-view class="screen-button-layer screen-button-layer--bottom-left" wx:if="{{!showDebugPanel && showBottomDebugButton}}" bindtap="handleToggleDebugPanel">
  78. <cover-view class="screen-button-layer__icon">
  79. <cover-view class="screen-button-layer__line"></cover-view>
  80. <cover-view class="screen-button-layer__stand"></cover-view>
  81. </cover-view>
  82. <cover-view class="screen-button-layer__text">调试</cover-view>
  83. </cover-view>
  84. <view class="race-panel">
  85. <view class="race-panel__tag race-panel__tag--top-left">目标</view>
  86. <view class="race-panel__tag race-panel__tag--top-right">里程</view>
  87. <view class="race-panel__tag race-panel__tag--bottom-left">点距</view>
  88. <view class="race-panel__tag race-panel__tag--bottom-right">速度</view>
  89. <view class="race-panel__line race-panel__line--center"></view>
  90. <view class="race-panel__line race-panel__line--left-mid"></view>
  91. <view class="race-panel__line race-panel__line--right-mid"></view>
  92. <view class="race-panel__line race-panel__line--left-top"></view>
  93. <view class="race-panel__line race-panel__line--left-bottom"></view>
  94. <view class="race-panel__line race-panel__line--right-top"></view>
  95. <view class="race-panel__line race-panel__line--right-bottom"></view>
  96. <view class="race-panel__grid">
  97. <view class="race-panel__cell race-panel__cell--action">
  98. <view class="race-panel__play"></view>
  99. </view>
  100. <view class="race-panel__cell race-panel__cell--timer">
  101. <text class="race-panel__timer">{{panelTimerText}}</text>
  102. </view>
  103. <view class="race-panel__cell race-panel__cell--mileage">
  104. <view class="race-panel__mileage-wrap">
  105. <text class="race-panel__mileage">{{panelMileageText}}</text>
  106. <view class="race-panel__chevrons">
  107. <view class="race-panel__chevron"></view>
  108. <view class="race-panel__chevron race-panel__chevron--offset"></view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="race-panel__cell race-panel__cell--distance">
  113. <view class="race-panel__metric-group race-panel__metric-group--left">
  114. <text class="race-panel__metric-value race-panel__metric-value--distance">{{panelDistanceValueText}}</text>
  115. <text class="race-panel__metric-unit race-panel__metric-unit--distance">m</text>
  116. </view>
  117. </view>
  118. <view class="race-panel__cell race-panel__cell--progress">
  119. <text class="race-panel__progress">{{panelProgressText}}</text>
  120. </view>
  121. <view class="race-panel__cell race-panel__cell--speed">
  122. <view class="race-panel__metric-group race-panel__metric-group--right">
  123. <text class="race-panel__metric-value race-panel__metric-value--speed">{{panelSpeedValueText}}</text>
  124. <text class="race-panel__metric-unit race-panel__metric-unit--speed">km/h</text>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="debug-modal" wx:if="{{showDebugPanel}}" bindtap="handleCloseDebugPanel">
  130. <view class="debug-modal__dialog" catchtap="handleDebugPanelTap">
  131. <view class="debug-modal__header">
  132. <view>
  133. <view class="debug-modal__eyebrow">DEBUG PANEL</view>
  134. <view class="debug-modal__title">地图调试信息</view>
  135. </view>
  136. <view class="debug-modal__close" bindtap="handleCloseDebugPanel">关闭</view>
  137. </view>
  138. <scroll-view class="debug-modal__content" scroll-y enhanced show-scrollbar="true">
  139. <view class="info-panel__row">
  140. <text class="info-panel__label">Build</text>
  141. <text class="info-panel__value">{{buildVersion}}</text>
  142. </view>
  143. <view class="info-panel__row info-panel__row--stack">
  144. <text class="info-panel__label">Config</text>
  145. <text class="info-panel__value">{{configStatusText}}</text>
  146. </view>
  147. <view class="info-panel__row">
  148. <text class="info-panel__label">Heading Mode</text>
  149. <text class="info-panel__value">{{orientationModeText}}</text>
  150. </view>
  151. <view class="info-panel__row">
  152. <text class="info-panel__label">Sensor Heading</text>
  153. <text class="info-panel__value">{{sensorHeadingText}}</text>
  154. </view>
  155. <view class="info-panel__row info-panel__row--stack">
  156. <text class="info-panel__label">North Ref</text>
  157. <text class="info-panel__value">{{northReferenceText}}</text>
  158. </view>
  159. <view class="info-panel__row">
  160. <text class="info-panel__label">Zoom</text>
  161. <text class="info-panel__value">{{zoom}}</text>
  162. </view>
  163. <view class="info-panel__row">
  164. <text class="info-panel__label">Rotation</text>
  165. <text class="info-panel__value">{{rotationText}}</text>
  166. </view>
  167. <view class="info-panel__row info-panel__row--stack">
  168. <text class="info-panel__label">Status</text>
  169. <text class="info-panel__value">{{statusText}}</text>
  170. </view>
  171. <view class="info-panel__row">
  172. <text class="info-panel__label">GPS</text>
  173. <text class="info-panel__value">{{gpsTrackingText}}</text>
  174. </view>
  175. <view class="info-panel__row info-panel__row--stack">
  176. <text class="info-panel__label">GPS Coord</text>
  177. <text class="info-panel__value">{{gpsCoordText}}</text>
  178. </view>
  179. <view class="info-panel__row">
  180. <text class="info-panel__label">Renderer</text>
  181. <text class="info-panel__value">{{renderMode}}</text>
  182. </view>
  183. <view class="info-panel__row info-panel__row--stack">
  184. <text class="info-panel__label">Projection</text>
  185. <text class="info-panel__value">{{projectionMode}}</text>
  186. </view>
  187. <view class="info-panel__row">
  188. <text class="info-panel__label">Auto Source</text>
  189. <text class="info-panel__value">{{autoRotateSourceText}}</text>
  190. </view>
  191. <view class="info-panel__row">
  192. <text class="info-panel__label">Calibration</text>
  193. <text class="info-panel__value">{{autoRotateCalibrationText}}</text>
  194. </view>
  195. <view class="info-panel__row info-panel__row--stack">
  196. <text class="info-panel__label">Tile URL</text>
  197. <text class="info-panel__value">{{tileSource}}</text>
  198. </view>
  199. <view class="info-panel__row">
  200. <text class="info-panel__label">Center Tile</text>
  201. <text class="info-panel__value">{{centerText}}</text>
  202. </view>
  203. <view class="info-panel__row">
  204. <text class="info-panel__label">Tile Size</text>
  205. <text class="info-panel__value">{{tileSizePx}}px</text>
  206. </view>
  207. <view class="info-panel__row">
  208. <text class="info-panel__label">Visible Tiles</text>
  209. <text class="info-panel__value">{{visibleTileCount}}</text>
  210. </view>
  211. <view class="info-panel__row">
  212. <text class="info-panel__label">Ready Tiles</text>
  213. <text class="info-panel__value">{{readyTileCount}}</text>
  214. </view>
  215. <view class="info-panel__row">
  216. <text class="info-panel__label">Memory Tiles</text>
  217. <text class="info-panel__value">{{memoryTileCount}}</text>
  218. </view>
  219. <view class="info-panel__row">
  220. <text class="info-panel__label">Disk Tiles</text>
  221. <text class="info-panel__value">{{diskTileCount}}</text>
  222. </view>
  223. <view class="info-panel__row">
  224. <text class="info-panel__label">Cache Hit</text>
  225. <text class="info-panel__value">{{cacheHitRateText}}</text>
  226. </view>
  227. <view class="info-panel__row">
  228. <text class="info-panel__label">Disk Hits</text>
  229. <text class="info-panel__value">{{diskHitCount}}</text>
  230. </view>
  231. <view class="info-panel__row">
  232. <text class="info-panel__label">Net Fetches</text>
  233. <text class="info-panel__value">{{networkFetchCount}}</text>
  234. </view>
  235. <view class="control-row">
  236. <view class="control-chip control-chip--primary" bindtap="handleRecenter">回到首屏</view>
  237. <view class="control-chip control-chip--secondary" bindtap="handleRotationReset">旋转归零</view>
  238. </view>
  239. <view class="control-row">
  240. <view class="control-chip {{gpsTracking ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleToggleGpsTracking">{{gpsTracking ? '停止定位' : '开启定位'}}</view>
  241. <view class="control-chip {{osmReferenceEnabled ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleToggleOsmReference">{{osmReferenceText}}</view>
  242. </view>
  243. <view class="control-row control-row--triple">
  244. <view class="control-chip {{orientationMode === 'manual' ? 'control-chip--active' : ''}}" bindtap="handleSetManualMode">手动</view>
  245. <view class="control-chip {{orientationMode === 'north-up' ? 'control-chip--active' : ''}}" bindtap="handleSetNorthUpMode">北朝上</view>
  246. <view class="control-chip {{orientationMode === 'heading-up' ? 'control-chip--active' : ''}}" bindtap="handleSetHeadingUpMode">朝向朝上</view>
  247. </view>
  248. <view class="control-row">
  249. <view class="control-chip control-chip--secondary" bindtap="handleCycleNorthReferenceMode">{{northReferenceButtonText}}</view>
  250. </view>
  251. <view class="control-row" wx:if="{{orientationMode === 'heading-up'}}">
  252. <view class="control-chip" bindtap="handleAutoRotateCalibrate">按当前方向校准</view>
  253. </view>
  254. <view class="control-row" wx:if="{{orientationMode === 'manual'}}">
  255. <view class="control-chip" bindtap="handleRotateStep">旋转 +15°</view>
  256. </view>
  257. </scroll-view>
  258. </view>
  259. </view>
  260. </view>