map.wxml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <view class="page">
  2. <view class="page__header">
  3. <view>
  4. <view class="page__eyebrow">CMR MINI PROGRAM</view>
  5. <view class="page__title">{{mapName}}</view>
  6. </view>
  7. <view class="page__badge">{{mapReadyText}}</view>
  8. </view>
  9. <view class="map-stage-wrap">
  10. <view
  11. class="map-stage"
  12. catchtouchstart="handleTouchStart"
  13. catchtouchmove="handleTouchMove"
  14. catchtouchend="handleTouchEnd"
  15. catchtouchcancel="handleTouchCancel"
  16. >
  17. <view class="map-content">
  18. <canvas
  19. id="mapCanvas"
  20. type="webgl"
  21. canvas-id="mapCanvas"
  22. class="map-canvas map-canvas--base"
  23. ></canvas>
  24. </view>
  25. <view class="map-stage__crosshair"></view>
  26. <view class="map-stage__overlay">
  27. <view class="overlay-card">
  28. <view class="overlay-card__label">WEBGL MAP ENGINE</view>
  29. <view class="overlay-card__title">North Up / Heading Up / Manual</view>
  30. <view class="overlay-card__desc">
  31. 地图北已经固定为正上方。现在支持手动旋转、北朝上、朝向朝上三种模式,并提供指北针用于校验朝向。
  32. </view>
  33. </view>
  34. <view class="compass-widget">
  35. <view class="compass-widget__ring">
  36. <view class="compass-widget__north">N</view>
  37. <view class="compass-widget__needle" style="transform: translateX(-50%) rotate({{compassNeedleDeg}}deg);"></view>
  38. <view class="compass-widget__center"></view>
  39. </view>
  40. <view class="compass-widget__label">{{sensorHeadingText}}</view>
  41. <view class="compass-widget__hint" wx:if="{{compassDeclinationText}}">{{compassDeclinationText}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <scroll-view class="info-panel" scroll-y enhanced show-scrollbar="true">
  47. <view class="info-panel__row">
  48. <text class="info-panel__label">Build</text>
  49. <text class="info-panel__value">{{buildVersion}}</text>
  50. </view>
  51. <view class="info-panel__row info-panel__row--stack">
  52. <text class="info-panel__label">Config</text>
  53. <text class="info-panel__value">{{configStatusText}}</text>
  54. </view>
  55. <view class="info-panel__row">
  56. <text class="info-panel__label">Heading Mode</text>
  57. <text class="info-panel__value">{{orientationModeText}}</text>
  58. </view>
  59. <view class="info-panel__row">
  60. <text class="info-panel__label">Sensor Heading</text>
  61. <text class="info-panel__value">{{sensorHeadingText}}</text>
  62. </view>
  63. <view class="info-panel__row info-panel__row--stack">
  64. <text class="info-panel__label">North Ref</text>
  65. <text class="info-panel__value">{{northReferenceText}}</text>
  66. </view>
  67. <view class="info-panel__row">
  68. <text class="info-panel__label">Zoom</text>
  69. <text class="info-panel__value">{{zoom}}</text>
  70. </view>
  71. <view class="info-panel__row">
  72. <text class="info-panel__label">Rotation</text>
  73. <text class="info-panel__value">{{rotationText}}</text>
  74. </view>
  75. <view class="info-panel__row info-panel__row--stack">
  76. <text class="info-panel__label">Status</text>
  77. <text class="info-panel__value">{{statusText}}</text>
  78. </view>
  79. <view class="info-panel__row">
  80. <text class="info-panel__label">GPS</text>
  81. <text class="info-panel__value">{{gpsTrackingText}}</text>
  82. </view>
  83. <view class="info-panel__row info-panel__row--stack">
  84. <text class="info-panel__label">GPS Coord</text>
  85. <text class="info-panel__value">{{gpsCoordText}}</text>
  86. </view>
  87. <view class="control-row">
  88. <view class="control-chip control-chip--secondary" bindtap="handleToggleDebugPanel">{{showDebugPanel ? '隐藏调试' : '查看调试'}}</view>
  89. </view>
  90. <block wx:if="{{showDebugPanel}}">
  91. <view class="info-panel__row">
  92. <text class="info-panel__label">Renderer</text>
  93. <text class="info-panel__value">{{renderMode}}</text>
  94. </view>
  95. <view class="info-panel__row info-panel__row--stack">
  96. <text class="info-panel__label">Projection</text>
  97. <text class="info-panel__value">{{projectionMode}}</text>
  98. </view>
  99. <view class="info-panel__row">
  100. <text class="info-panel__label">Auto Source</text>
  101. <text class="info-panel__value">{{autoRotateSourceText}}</text>
  102. </view>
  103. <view class="info-panel__row">
  104. <text class="info-panel__label">Calibration</text>
  105. <text class="info-panel__value">{{autoRotateCalibrationText}}</text>
  106. </view>
  107. <view class="info-panel__row info-panel__row--stack">
  108. <text class="info-panel__label">Tile URL</text>
  109. <text class="info-panel__value">{{tileSource}}</text>
  110. </view>
  111. <view class="info-panel__row">
  112. <text class="info-panel__label">Center Tile</text>
  113. <text class="info-panel__value">{{centerText}}</text>
  114. </view>
  115. <view class="info-panel__row">
  116. <text class="info-panel__label">Tile Size</text>
  117. <text class="info-panel__value">{{tileSizePx}}px</text>
  118. </view>
  119. <view class="info-panel__row">
  120. <text class="info-panel__label">Visible Tiles</text>
  121. <text class="info-panel__value">{{visibleTileCount}}</text>
  122. </view>
  123. <view class="info-panel__row">
  124. <text class="info-panel__label">Ready Tiles</text>
  125. <text class="info-panel__value">{{readyTileCount}}</text>
  126. </view>
  127. <view class="info-panel__row">
  128. <text class="info-panel__label">Memory Tiles</text>
  129. <text class="info-panel__value">{{memoryTileCount}}</text>
  130. </view>
  131. <view class="info-panel__row">
  132. <text class="info-panel__label">Disk Tiles</text>
  133. <text class="info-panel__value">{{diskTileCount}}</text>
  134. </view>
  135. <view class="info-panel__row">
  136. <text class="info-panel__label">Cache Hit</text>
  137. <text class="info-panel__value">{{cacheHitRateText}}</text>
  138. </view>
  139. <view class="info-panel__row">
  140. <text class="info-panel__label">Disk Hits</text>
  141. <text class="info-panel__value">{{diskHitCount}}</text>
  142. </view>
  143. <view class="info-panel__row">
  144. <text class="info-panel__label">Net Fetches</text>
  145. <text class="info-panel__value">{{networkFetchCount}}</text>
  146. </view>
  147. </block>
  148. <view class="control-row">
  149. <view class="control-chip control-chip--primary" bindtap="handleRecenter">回到首屏</view>
  150. <view class="control-chip control-chip--secondary" bindtap="handleRotationReset">旋转归零</view>
  151. </view>
  152. <view class="control-row">
  153. <view class="control-chip {{gpsTracking ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleToggleGpsTracking">{{gpsTracking ? '停止定位' : '开启定位'}}</view>
  154. <view class="control-chip {{osmReferenceEnabled ? 'control-chip--active' : 'control-chip--secondary'}}" bindtap="handleToggleOsmReference">{{osmReferenceText}}</view>
  155. </view>
  156. <view class="control-row control-row--triple">
  157. <view class="control-chip {{orientationMode === 'manual' ? 'control-chip--active' : ''}}" bindtap="handleSetManualMode">手动</view>
  158. <view class="control-chip {{orientationMode === 'north-up' ? 'control-chip--active' : ''}}" bindtap="handleSetNorthUpMode">北朝上</view>
  159. <view class="control-chip {{orientationMode === 'heading-up' ? 'control-chip--active' : ''}}" bindtap="handleSetHeadingUpMode">朝向朝上</view>
  160. </view>
  161. <view class="control-row">
  162. <view class="control-chip control-chip--secondary" bindtap="handleCycleNorthReferenceMode">{{northReferenceButtonText}}</view>
  163. </view>
  164. <view class="control-row" wx:if="{{orientationMode === 'heading-up'}}">
  165. <view class="control-chip" bindtap="handleAutoRotateCalibrate">按当前方向校准</view>
  166. </view>
  167. <view class="control-row" wx:if="{{orientationMode === 'manual'}}">
  168. <view class="control-chip" bindtap="handleRotateStep">旋转 +15°</view>
  169. </view>
  170. </scroll-view>
  171. </view>