map.wxml 16 KB

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