map.wxml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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>
  42. </view>
  43. </view>
  44. </view>
  45. <scroll-view class="info-panel" scroll-y enhanced show-scrollbar="true">
  46. <view class="info-panel__row">
  47. <text class="info-panel__label">Heading Mode</text>
  48. <text class="info-panel__value">{{orientationModeText}}</text>
  49. </view>
  50. <view class="info-panel__row">
  51. <text class="info-panel__label">Sensor Heading</text>
  52. <text class="info-panel__value">{{sensorHeadingText}}</text>
  53. </view>
  54. <view class="info-panel__row">
  55. <text class="info-panel__label">Zoom</text>
  56. <text class="info-panel__value">{{zoom}}</text>
  57. </view>
  58. <view class="info-panel__row">
  59. <text class="info-panel__label">Rotation</text>
  60. <text class="info-panel__value">{{rotationText}}</text>
  61. </view>
  62. <view class="info-panel__row info-panel__row--stack">
  63. <text class="info-panel__label">Status</text>
  64. <text class="info-panel__value">{{statusText}}</text>
  65. </view>
  66. <view class="control-row">
  67. <view class="control-chip control-chip--secondary" bindtap="handleToggleDebugPanel">{{showDebugPanel ? '隐藏调试' : '查看调试'}}</view>
  68. </view>
  69. <block wx:if="{{showDebugPanel}}">
  70. <view class="info-panel__row">
  71. <text class="info-panel__label">Build</text>
  72. <text class="info-panel__value">{{buildVersion}}</text>
  73. </view>
  74. <view class="info-panel__row">
  75. <text class="info-panel__label">Renderer</text>
  76. <text class="info-panel__value">{{renderMode}}</text>
  77. </view>
  78. <view class="info-panel__row info-panel__row--stack">
  79. <text class="info-panel__label">Projection</text>
  80. <text class="info-panel__value">{{projectionMode}}</text>
  81. </view>
  82. <view class="info-panel__row">
  83. <text class="info-panel__label">North Ref</text>
  84. <text class="info-panel__value">{{northReferenceText}}</text>
  85. </view>
  86. <view class="info-panel__row">
  87. <text class="info-panel__label">Auto Source</text>
  88. <text class="info-panel__value">{{autoRotateSourceText}}</text>
  89. </view>
  90. <view class="info-panel__row">
  91. <text class="info-panel__label">Calibration</text>
  92. <text class="info-panel__value">{{autoRotateCalibrationText}}</text>
  93. </view>
  94. <view class="info-panel__row info-panel__row--stack">
  95. <text class="info-panel__label">Tile URL</text>
  96. <text class="info-panel__value">{{tileSource}}</text>
  97. </view>
  98. <view class="info-panel__row">
  99. <text class="info-panel__label">Center Tile</text>
  100. <text class="info-panel__value">{{centerText}}</text>
  101. </view>
  102. <view class="info-panel__row">
  103. <text class="info-panel__label">Tile Size</text>
  104. <text class="info-panel__value">{{tileSizePx}}px</text>
  105. </view>
  106. <view class="info-panel__row">
  107. <text class="info-panel__label">Visible Tiles</text>
  108. <text class="info-panel__value">{{visibleTileCount}}</text>
  109. </view>
  110. <view class="info-panel__row">
  111. <text class="info-panel__label">Ready Tiles</text>
  112. <text class="info-panel__value">{{readyTileCount}}</text>
  113. </view>
  114. <view class="info-panel__row">
  115. <text class="info-panel__label">Memory Tiles</text>
  116. <text class="info-panel__value">{{memoryTileCount}}</text>
  117. </view>
  118. <view class="info-panel__row">
  119. <text class="info-panel__label">Disk Tiles</text>
  120. <text class="info-panel__value">{{diskTileCount}}</text>
  121. </view>
  122. <view class="info-panel__row">
  123. <text class="info-panel__label">Cache Hit</text>
  124. <text class="info-panel__value">{{cacheHitRateText}}</text>
  125. </view>
  126. <view class="info-panel__row">
  127. <text class="info-panel__label">Disk Hits</text>
  128. <text class="info-panel__value">{{diskHitCount}}</text>
  129. </view>
  130. <view class="info-panel__row">
  131. <text class="info-panel__label">Net Fetches</text>
  132. <text class="info-panel__value">{{networkFetchCount}}</text>
  133. </view>
  134. </block>
  135. <view class="control-row">
  136. <view class="control-chip control-chip--primary" bindtap="handleRecenter">回到首屏</view>
  137. <view class="control-chip control-chip--secondary" bindtap="handleRotationReset">旋转归零</view>
  138. </view>
  139. <view class="control-row control-row--triple">
  140. <view class="control-chip {{orientationMode === 'manual' ? 'control-chip--active' : ''}}" bindtap="handleSetManualMode">手动</view>
  141. <view class="control-chip {{orientationMode === 'north-up' ? 'control-chip--active' : ''}}" bindtap="handleSetNorthUpMode">北朝上</view>
  142. <view class="control-chip {{orientationMode === 'heading-up' ? 'control-chip--active' : ''}}" bindtap="handleSetHeadingUpMode">朝向朝上</view>
  143. </view>
  144. <view class="control-row" wx:if="{{orientationMode === 'heading-up'}}">
  145. <view class="control-chip" bindtap="handleAutoRotateCalibrate">按当前方向校准</view>
  146. </view>
  147. <view class="control-row" wx:if="{{orientationMode === 'manual'}}">
  148. <view class="control-chip" bindtap="handleRotateStep">旋转 +15°</view>
  149. </view>
  150. </scroll-view>
  151. </view>