@tarojs/components 4.1.5-beta.7 → 4.1.5-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (897) hide show
  1. package/dist/cjs/index.cjs.js +0 -205
  2. package/dist/cjs/taro-ad-core.cjs.entry.js +14 -5
  3. package/dist/cjs/taro-ad-custom-core.cjs.entry.js +14 -5
  4. package/dist/cjs/taro-animation-video-core.cjs.entry.js +14 -5
  5. package/dist/cjs/taro-animation-view-core.cjs.entry.js +14 -5
  6. package/dist/cjs/taro-ar-camera-core.cjs.entry.js +14 -5
  7. package/dist/cjs/taro-audio-core.cjs.entry.js +51 -3
  8. package/dist/cjs/taro-aweme-data-core.cjs.entry.js +14 -5
  9. package/dist/cjs/taro-block-core.cjs.entry.js +10 -4
  10. package/dist/cjs/taro-button-core.cjs.entry.js +68 -4
  11. package/dist/cjs/taro-camera-core.cjs.entry.js +14 -5
  12. package/dist/cjs/taro-canvas-core.cjs.entry.js +44 -3
  13. package/dist/cjs/taro-channel-live-core.cjs.entry.js +14 -5
  14. package/dist/cjs/taro-channel-video-core.cjs.entry.js +14 -5
  15. package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +117 -4
  16. package/dist/cjs/taro-comment-detail-core.cjs.entry.js +14 -5
  17. package/dist/cjs/taro-comment-list-core.cjs.entry.js +14 -5
  18. package/dist/cjs/taro-contact-button-core.cjs.entry.js +14 -5
  19. package/dist/cjs/taro-cover-image-core.cjs.entry.js +27 -3
  20. package/dist/cjs/taro-cover-view-core.cjs.entry.js +60 -4
  21. package/dist/cjs/taro-custom-wrapper-core.cjs.entry.js +10 -4
  22. package/dist/cjs/taro-double-tap-gesture-handler-core.cjs.entry.js +14 -5
  23. package/dist/cjs/taro-draggable-sheet-core.cjs.entry.js +14 -5
  24. package/dist/cjs/taro-editor-core.cjs.entry.js +14 -5
  25. package/dist/cjs/taro-follow-swan-core.cjs.entry.js +14 -5
  26. package/dist/cjs/taro-force-press-gesture-handler-core.cjs.entry.js +14 -5
  27. package/dist/cjs/taro-form-core.cjs.entry.js +137 -4
  28. package/dist/cjs/taro-functional-page-navigator-core.cjs.entry.js +14 -5
  29. package/dist/cjs/taro-grid-builder-core.cjs.entry.js +14 -5
  30. package/dist/cjs/taro-grid-view-core.cjs.entry.js +14 -5
  31. package/dist/cjs/taro-horizontal-drag-gesture-handler-core.cjs.entry.js +14 -5
  32. package/dist/cjs/taro-icon-core.cjs.entry.js +25 -4
  33. package/dist/cjs/taro-image-core.cjs.entry.js +55 -4
  34. package/dist/cjs/taro-inline-payment-panel-core.cjs.entry.js +14 -5
  35. package/dist/cjs/taro-input-core.cjs.entry.js +208 -3
  36. package/dist/cjs/taro-keyboard-accessory-core.cjs.entry.js +14 -5
  37. package/dist/cjs/taro-label-core.cjs.entry.js +11 -4
  38. package/dist/cjs/taro-lifestyle-core.cjs.entry.js +14 -5
  39. package/dist/cjs/taro-like-core.cjs.entry.js +14 -5
  40. package/dist/cjs/taro-list-builder-core.cjs.entry.js +14 -5
  41. package/dist/cjs/taro-list-view-core.cjs.entry.js +14 -5
  42. package/dist/cjs/taro-live-player-core.cjs.entry.js +14 -5
  43. package/dist/cjs/taro-live-pusher-core.cjs.entry.js +14 -5
  44. package/dist/cjs/taro-login-core.cjs.entry.js +14 -5
  45. package/dist/cjs/taro-long-press-gesture-handler-core.cjs.entry.js +14 -5
  46. package/dist/cjs/taro-lottie-core.cjs.entry.js +14 -5
  47. package/dist/cjs/taro-map-core.cjs.entry.js +1333 -4
  48. package/dist/cjs/taro-match-media-core.cjs.entry.js +14 -5
  49. package/dist/cjs/taro-movable-area-core_2.cjs.entry.js +477 -5
  50. package/dist/cjs/taro-native-slot-core.cjs.entry.js +14 -5
  51. package/dist/cjs/taro-navigation-bar-core.cjs.entry.js +14 -5
  52. package/dist/cjs/taro-navigator-core.cjs.entry.js +72 -5
  53. package/dist/cjs/taro-nested-scroll-body-core.cjs.entry.js +14 -5
  54. package/dist/cjs/taro-nested-scroll-header-core.cjs.entry.js +14 -5
  55. package/dist/cjs/taro-official-account-core.cjs.entry.js +14 -5
  56. package/dist/cjs/taro-open-container-core.cjs.entry.js +14 -5
  57. package/dist/cjs/taro-open-data-core.cjs.entry.js +14 -5
  58. package/dist/cjs/taro-page-container-core.cjs.entry.js +14 -5
  59. package/dist/cjs/taro-page-meta-core.cjs.entry.js +14 -5
  60. package/dist/cjs/taro-pan-gesture-handler-core.cjs.entry.js +14 -5
  61. package/dist/cjs/taro-picker-core_2.cjs.entry.js +684 -5
  62. package/dist/cjs/taro-picker-view-column-core_2.cjs.entry.js +174 -6
  63. package/dist/cjs/taro-progress-core.cjs.entry.js +34 -3
  64. package/dist/cjs/taro-pull-to-refresh-core.cjs.entry.js +264 -5
  65. package/dist/cjs/taro-radio-core_2.cjs.entry.js +131 -4
  66. package/dist/cjs/taro-rich-text-core.cjs.entry.js +68 -3
  67. package/dist/cjs/taro-root-portal-core.cjs.entry.js +14 -5
  68. package/dist/cjs/taro-rtc-room-core.cjs.entry.js +14 -5
  69. package/dist/cjs/taro-rtc-room-item-core.cjs.entry.js +14 -5
  70. package/dist/cjs/taro-scale-gesture-handler-core.cjs.entry.js +14 -5
  71. package/dist/cjs/taro-script-core.cjs.entry.js +14 -5
  72. package/dist/cjs/taro-scroll-view-core.cjs.entry.js +165 -6
  73. package/dist/cjs/taro-share-element-core.cjs.entry.js +14 -5
  74. package/dist/cjs/taro-slider-core.cjs.entry.js +158 -3
  75. package/dist/cjs/taro-slot-core.cjs.entry.js +14 -5
  76. package/dist/cjs/taro-snapshot-core.cjs.entry.js +14 -5
  77. package/dist/cjs/taro-span-core.cjs.entry.js +14 -5
  78. package/dist/cjs/taro-sticky-header-core.cjs.entry.js +14 -5
  79. package/dist/cjs/taro-sticky-section-core.cjs.entry.js +14 -5
  80. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +422 -8
  81. package/dist/cjs/taro-switch-core.cjs.entry.js +57 -3
  82. package/dist/cjs/taro-tab-item-core.cjs.entry.js +14 -5
  83. package/dist/cjs/taro-tabbar.cjs.entry.js +347 -8
  84. package/dist/cjs/taro-tabs-core.cjs.entry.js +14 -5
  85. package/dist/cjs/taro-tap-gesture-handler-core.cjs.entry.js +14 -5
  86. package/dist/cjs/taro-text-core.cjs.entry.js +20 -3
  87. package/dist/cjs/taro-textarea-core.cjs.entry.js +156 -3
  88. package/dist/cjs/taro-vertical-drag-gesture-handler-core.cjs.entry.js +14 -5
  89. package/dist/cjs/taro-video-control_3.cjs.entry.js +743 -8
  90. package/dist/cjs/taro-view-core.cjs.entry.js +65 -5
  91. package/dist/cjs/taro-voip-room-core.cjs.entry.js +14 -5
  92. package/dist/cjs/taro-web-view-core.cjs.entry.js +22 -3
  93. package/dist/collection/index.js +1 -1
  94. package/dist/components/index.js +96 -98
  95. package/dist/components/taro-ad-core.js +1 -1
  96. package/dist/components/taro-ad-custom-core.js +1 -1
  97. package/dist/components/taro-animation-video-core.js +1 -1
  98. package/dist/components/taro-animation-view-core.js +1 -1
  99. package/dist/components/taro-ar-camera-core.js +1 -1
  100. package/dist/components/taro-audio-core.js +1 -1
  101. package/dist/components/taro-aweme-data-core.js +1 -1
  102. package/dist/components/taro-block-core.js +1 -1
  103. package/dist/components/taro-button-core.js +1 -1
  104. package/dist/components/taro-camera-core.js +1 -1
  105. package/dist/components/taro-canvas-core.js +1 -1
  106. package/dist/components/taro-channel-live-core.js +1 -1
  107. package/dist/components/taro-channel-video-core.js +1 -1
  108. package/dist/components/taro-checkbox-core.js +1 -1
  109. package/dist/components/taro-checkbox-group-core.js +1 -1
  110. package/dist/components/taro-comment-detail-core.js +1 -1
  111. package/dist/components/taro-comment-list-core.js +1 -1
  112. package/dist/components/taro-contact-button-core.js +1 -1
  113. package/dist/components/taro-cover-image-core.js +1 -1
  114. package/dist/components/taro-cover-view-core.js +1 -1
  115. package/dist/components/taro-custom-wrapper-core.js +1 -1
  116. package/dist/components/taro-double-tap-gesture-handler-core.js +1 -1
  117. package/dist/components/taro-draggable-sheet-core.js +1 -1
  118. package/dist/components/taro-editor-core.js +1 -1
  119. package/dist/components/taro-follow-swan-core.js +1 -1
  120. package/dist/components/taro-force-press-gesture-handler-core.js +1 -1
  121. package/dist/components/taro-form-core.js +1 -1
  122. package/dist/components/taro-functional-page-navigator-core.js +1 -1
  123. package/dist/components/taro-grid-builder-core.js +1 -1
  124. package/dist/components/taro-grid-view-core.js +1 -1
  125. package/dist/components/taro-horizontal-drag-gesture-handler-core.js +1 -1
  126. package/dist/components/taro-icon-core.js +1 -1
  127. package/dist/components/taro-image-core.js +1 -1
  128. package/dist/components/taro-inline-payment-panel-core.js +1 -1
  129. package/dist/components/taro-input-core.js +1 -1
  130. package/dist/components/taro-keyboard-accessory-core.js +1 -1
  131. package/dist/components/taro-label-core.js +1 -1
  132. package/dist/components/taro-lifestyle-core.js +1 -1
  133. package/dist/components/taro-like-core.js +1 -1
  134. package/dist/components/taro-list-builder-core.js +1 -1
  135. package/dist/components/taro-list-view-core.js +1 -1
  136. package/dist/components/taro-live-player-core.js +1 -1
  137. package/dist/components/taro-live-pusher-core.js +1 -1
  138. package/dist/components/taro-login-core.js +1 -1
  139. package/dist/components/taro-long-press-gesture-handler-core.js +1 -1
  140. package/dist/components/taro-lottie-core.js +1 -1
  141. package/dist/components/taro-map-core.js +1 -1
  142. package/dist/components/taro-match-media-core.js +1 -1
  143. package/dist/components/taro-movable-area-core.js +1 -1
  144. package/dist/components/taro-movable-view-core.js +1 -1
  145. package/dist/components/taro-native-slot-core.js +1 -1
  146. package/dist/components/taro-navigation-bar-core.js +1 -1
  147. package/dist/components/taro-navigator-core.js +1 -1
  148. package/dist/components/taro-nested-scroll-body-core.js +1 -1
  149. package/dist/components/taro-nested-scroll-header-core.js +1 -1
  150. package/dist/components/taro-official-account-core.js +1 -1
  151. package/dist/components/taro-open-container-core.js +1 -1
  152. package/dist/components/taro-open-data-core.js +1 -1
  153. package/dist/components/taro-page-container-core.js +1 -1
  154. package/dist/components/taro-page-meta-core.js +1 -1
  155. package/dist/components/taro-pan-gesture-handler-core.js +1 -1
  156. package/dist/components/taro-picker-core.js +1 -1
  157. package/dist/components/taro-picker-view-column-core.js +1 -1
  158. package/dist/components/taro-picker-view-core.js +1 -1
  159. package/dist/components/taro-progress-core.js +1 -1
  160. package/dist/components/taro-pull-to-refresh-core.js +1 -1
  161. package/dist/components/taro-radio-core.js +1 -1
  162. package/dist/components/taro-radio-group-core.js +1 -1
  163. package/dist/components/taro-rich-text-core.js +1 -1
  164. package/dist/components/taro-root-portal-core.js +1 -1
  165. package/dist/components/taro-rtc-room-core.js +1 -1
  166. package/dist/components/taro-rtc-room-item-core.js +1 -1
  167. package/dist/components/taro-scale-gesture-handler-core.js +1 -1
  168. package/dist/components/taro-script-core.js +1 -1
  169. package/dist/components/taro-scroll-view-core.js +1 -1
  170. package/dist/components/taro-share-element-core.js +1 -1
  171. package/dist/components/taro-slider-core.js +1 -1
  172. package/dist/components/taro-slot-core.js +1 -1
  173. package/dist/components/taro-snapshot-core.js +1 -1
  174. package/dist/components/taro-span-core.js +1 -1
  175. package/dist/components/taro-sticky-header-core.js +1 -1
  176. package/dist/components/taro-sticky-section-core.js +1 -1
  177. package/dist/components/taro-swiper-core.js +1 -1
  178. package/dist/components/taro-swiper-item-core.js +1 -1
  179. package/dist/components/taro-switch-core.js +1 -1
  180. package/dist/components/taro-tab-item-core.js +1 -1
  181. package/dist/components/taro-tabbar.js +1 -1
  182. package/dist/components/taro-tabs-core.js +1 -1
  183. package/dist/components/taro-tap-gesture-handler-core.js +1 -1
  184. package/dist/components/taro-text-core.js +1 -1
  185. package/dist/components/taro-textarea-core.js +1 -1
  186. package/dist/components/taro-vertical-drag-gesture-handler-core.js +1 -1
  187. package/dist/components/taro-video-core.js +2 -2
  188. package/dist/components/taro-view-core.js +1 -1
  189. package/dist/components/taro-voip-room-core.js +1 -1
  190. package/dist/components/taro-web-view-core.js +1 -1
  191. package/dist/esm/index.js +1 -100
  192. package/dist/esm/taro-ad-core.entry.js +16 -3
  193. package/dist/esm/taro-ad-custom-core.entry.js +16 -3
  194. package/dist/esm/taro-animation-video-core.entry.js +16 -3
  195. package/dist/esm/taro-animation-view-core.entry.js +16 -3
  196. package/dist/esm/taro-ar-camera-core.entry.js +16 -3
  197. package/dist/esm/taro-audio-core.entry.js +54 -2
  198. package/dist/esm/taro-aweme-data-core.entry.js +16 -3
  199. package/dist/esm/taro-block-core.entry.js +12 -2
  200. package/dist/esm/taro-button-core.entry.js +71 -3
  201. package/dist/esm/taro-camera-core.entry.js +16 -3
  202. package/dist/esm/taro-canvas-core.entry.js +47 -2
  203. package/dist/esm/taro-channel-live-core.entry.js +16 -3
  204. package/dist/esm/taro-channel-video-core.entry.js +16 -3
  205. package/dist/esm/taro-checkbox-core_2.entry.js +119 -2
  206. package/dist/esm/taro-comment-detail-core.entry.js +16 -3
  207. package/dist/esm/taro-comment-list-core.entry.js +16 -3
  208. package/dist/esm/taro-contact-button-core.entry.js +16 -3
  209. package/dist/esm/taro-cover-image-core.entry.js +30 -2
  210. package/dist/esm/taro-cover-view-core.entry.js +63 -3
  211. package/dist/esm/taro-custom-wrapper-core.entry.js +12 -2
  212. package/dist/esm/taro-double-tap-gesture-handler-core.entry.js +16 -3
  213. package/dist/esm/taro-draggable-sheet-core.entry.js +16 -3
  214. package/dist/esm/taro-editor-core.entry.js +16 -3
  215. package/dist/esm/taro-follow-swan-core.entry.js +16 -3
  216. package/dist/esm/taro-force-press-gesture-handler-core.entry.js +16 -3
  217. package/dist/esm/taro-form-core.entry.js +139 -2
  218. package/dist/esm/taro-functional-page-navigator-core.entry.js +16 -3
  219. package/dist/esm/taro-grid-builder-core.entry.js +16 -3
  220. package/dist/esm/taro-grid-view-core.entry.js +16 -3
  221. package/dist/esm/taro-horizontal-drag-gesture-handler-core.entry.js +16 -3
  222. package/dist/esm/taro-icon-core.entry.js +28 -3
  223. package/dist/esm/taro-image-core.entry.js +58 -3
  224. package/dist/esm/taro-inline-payment-panel-core.entry.js +16 -3
  225. package/dist/esm/taro-input-core.entry.js +211 -2
  226. package/dist/esm/taro-keyboard-accessory-core.entry.js +16 -3
  227. package/dist/esm/taro-label-core.entry.js +13 -2
  228. package/dist/esm/taro-lifestyle-core.entry.js +16 -3
  229. package/dist/esm/taro-like-core.entry.js +16 -3
  230. package/dist/esm/taro-list-builder-core.entry.js +16 -3
  231. package/dist/esm/taro-list-view-core.entry.js +16 -3
  232. package/dist/esm/taro-live-player-core.entry.js +16 -3
  233. package/dist/esm/taro-live-pusher-core.entry.js +16 -3
  234. package/dist/esm/taro-login-core.entry.js +16 -3
  235. package/dist/esm/taro-long-press-gesture-handler-core.entry.js +16 -3
  236. package/dist/esm/taro-lottie-core.entry.js +16 -3
  237. package/dist/esm/taro-map-core.entry.js +1332 -3
  238. package/dist/esm/taro-match-media-core.entry.js +16 -3
  239. package/dist/esm/taro-movable-area-core_2.entry.js +479 -3
  240. package/dist/esm/taro-native-slot-core.entry.js +16 -3
  241. package/dist/esm/taro-navigation-bar-core.entry.js +16 -3
  242. package/dist/esm/taro-navigator-core.entry.js +71 -4
  243. package/dist/esm/taro-nested-scroll-body-core.entry.js +16 -3
  244. package/dist/esm/taro-nested-scroll-header-core.entry.js +16 -3
  245. package/dist/esm/taro-official-account-core.entry.js +16 -3
  246. package/dist/esm/taro-open-container-core.entry.js +16 -3
  247. package/dist/esm/taro-open-data-core.entry.js +16 -3
  248. package/dist/esm/taro-page-container-core.entry.js +16 -3
  249. package/dist/esm/taro-page-meta-core.entry.js +16 -3
  250. package/dist/esm/taro-pan-gesture-handler-core.entry.js +16 -3
  251. package/dist/esm/taro-picker-core_2.entry.js +686 -3
  252. package/dist/esm/taro-picker-view-column-core_2.entry.js +176 -4
  253. package/dist/esm/taro-progress-core.entry.js +37 -2
  254. package/dist/esm/taro-pull-to-refresh-core.entry.js +263 -4
  255. package/dist/esm/taro-radio-core_2.entry.js +133 -2
  256. package/dist/esm/taro-rich-text-core.entry.js +71 -2
  257. package/dist/esm/taro-root-portal-core.entry.js +16 -3
  258. package/dist/esm/taro-rtc-room-core.entry.js +16 -3
  259. package/dist/esm/taro-rtc-room-item-core.entry.js +16 -3
  260. package/dist/esm/taro-scale-gesture-handler-core.entry.js +16 -3
  261. package/dist/esm/taro-script-core.entry.js +16 -3
  262. package/dist/esm/taro-scroll-view-core.entry.js +168 -5
  263. package/dist/esm/taro-share-element-core.entry.js +16 -3
  264. package/dist/esm/taro-slider-core.entry.js +161 -2
  265. package/dist/esm/taro-slot-core.entry.js +16 -3
  266. package/dist/esm/taro-snapshot-core.entry.js +16 -3
  267. package/dist/esm/taro-span-core.entry.js +16 -3
  268. package/dist/esm/taro-sticky-header-core.entry.js +16 -3
  269. package/dist/esm/taro-sticky-section-core.entry.js +16 -3
  270. package/dist/esm/taro-swiper-core_2.entry.js +420 -6
  271. package/dist/esm/taro-switch-core.entry.js +60 -2
  272. package/dist/esm/taro-tab-item-core.entry.js +16 -3
  273. package/dist/esm/taro-tabbar.entry.js +345 -7
  274. package/dist/esm/taro-tabs-core.entry.js +16 -3
  275. package/dist/esm/taro-tap-gesture-handler-core.entry.js +16 -3
  276. package/dist/esm/taro-text-core.entry.js +23 -2
  277. package/dist/esm/taro-textarea-core.entry.js +159 -2
  278. package/dist/esm/taro-vertical-drag-gesture-handler-core.entry.js +16 -3
  279. package/dist/esm/taro-video-control_3.entry.js +720 -5
  280. package/dist/esm/taro-view-core.entry.js +68 -4
  281. package/dist/esm/taro-voip-room-core.entry.js +16 -3
  282. package/dist/esm/taro-web-view-core.entry.js +25 -2
  283. package/dist/taro-components/index.esm.js +0 -1
  284. package/dist/taro-components/p-00ba8330.entry.js +1 -0
  285. package/dist/taro-components/p-01285c99.entry.js +1 -0
  286. package/dist/taro-components/p-028a06be.entry.js +1 -0
  287. package/dist/taro-components/p-02dfd28a.entry.js +1 -0
  288. package/dist/taro-components/p-041adaea.entry.js +1 -0
  289. package/dist/taro-components/p-053f9336.entry.js +1 -0
  290. package/dist/taro-components/{p-d1a1274a.js → p-07864e09.entry.js} +1 -1
  291. package/dist/taro-components/p-0adabf61.entry.js +1 -0
  292. package/dist/taro-components/p-0ea53611.entry.js +1 -0
  293. package/dist/taro-components/{p-553b9dc1.js → p-12075d7a.entry.js} +1 -1
  294. package/dist/taro-components/p-1524f0a7.entry.js +1 -0
  295. package/dist/taro-components/p-1c499e26.entry.js +1 -0
  296. package/dist/taro-components/p-1ce39dc0.entry.js +1 -0
  297. package/dist/taro-components/p-1e0c4a2f.entry.js +1 -0
  298. package/dist/taro-components/p-1e8b1d53.entry.js +1 -0
  299. package/dist/taro-components/p-262d3cc6.entry.js +1 -0
  300. package/dist/taro-components/{p-c7f9e228.js → p-27392e58.entry.js} +1 -1
  301. package/dist/taro-components/p-27e67e4c.entry.js +1 -0
  302. package/dist/taro-components/p-2f681c42.entry.js +1 -0
  303. package/dist/taro-components/p-2f7ecf80.entry.js +1 -0
  304. package/dist/taro-components/{p-a6c178f3.js → p-31998393.entry.js} +1 -1
  305. package/dist/taro-components/p-349011e5.entry.js +1 -0
  306. package/dist/taro-components/p-37774f52.entry.js +1 -0
  307. package/dist/taro-components/p-3a0afbaa.entry.js +1 -0
  308. package/dist/taro-components/p-3aabc29c.entry.js +1 -0
  309. package/dist/taro-components/{p-2b1afb2c.js → p-3b0507ef.entry.js} +1 -1
  310. package/dist/taro-components/p-3fe35d51.entry.js +1 -0
  311. package/dist/taro-components/p-41d62a49.entry.js +1 -0
  312. package/dist/taro-components/p-452f2d23.entry.js +1 -0
  313. package/dist/taro-components/p-45415f8a.entry.js +1 -0
  314. package/dist/taro-components/p-4db97a66.entry.js +1 -0
  315. package/dist/taro-components/p-523197fa.entry.js +1 -0
  316. package/dist/taro-components/p-53f2859c.entry.js +1 -0
  317. package/dist/taro-components/{p-1c317d71.js → p-5534e4e7.entry.js} +1 -1
  318. package/dist/taro-components/p-553ab0f6.entry.js +1 -0
  319. package/dist/taro-components/{p-1f81d4f4.js → p-589e0de6.entry.js} +1 -1
  320. package/dist/taro-components/p-5e4fa085.entry.js +1 -0
  321. package/dist/taro-components/p-5efcb8c2.entry.js +1 -0
  322. package/dist/taro-components/p-5efe8af4.entry.js +1 -0
  323. package/dist/taro-components/p-64476900.entry.js +1 -0
  324. package/dist/taro-components/p-64eab0b1.entry.js +1 -0
  325. package/dist/taro-components/p-67c93469.entry.js +1 -0
  326. package/dist/taro-components/p-6c93f8b0.entry.js +1 -0
  327. package/dist/taro-components/p-716f9758.entry.js +1 -0
  328. package/dist/taro-components/p-72dc94f1.entry.js +1 -0
  329. package/dist/taro-components/p-763b130b.entry.js +1 -0
  330. package/dist/taro-components/{p-53b69659.js → p-7717e485.entry.js} +1 -1
  331. package/dist/taro-components/p-79a3916f.entry.js +1 -0
  332. package/dist/taro-components/p-82699c7b.entry.js +1 -0
  333. package/dist/taro-components/{p-24ef5f8c.js → p-826f9f91.entry.js} +1 -1
  334. package/dist/taro-components/{p-67c4cf7e.js → p-82d74d01.entry.js} +1 -1
  335. package/dist/taro-components/p-9108e872.entry.js +1 -0
  336. package/dist/taro-components/p-96054089.entry.js +1 -0
  337. package/dist/taro-components/p-98ce7aae.entry.js +1 -0
  338. package/dist/taro-components/p-9b1d4fbc.entry.js +1 -0
  339. package/dist/taro-components/p-9cfe7bc7.entry.js +1 -0
  340. package/dist/taro-components/p-a4b9f9b8.entry.js +1 -0
  341. package/dist/taro-components/{p-35aac6e0.js → p-a5b32f59.entry.js} +1 -1
  342. package/dist/taro-components/{p-6e2f460d.js → p-a8d628f8.entry.js} +1 -1
  343. package/dist/taro-components/p-aabad1f7.entry.js +1 -0
  344. package/dist/taro-components/p-ac41c34a.entry.js +1 -0
  345. package/dist/taro-components/p-b4eb9ea9.entry.js +1 -0
  346. package/dist/taro-components/p-bd725f0c.entry.js +1 -0
  347. package/dist/taro-components/{p-4d79a974.js → p-bd7ab2a5.entry.js} +1 -1
  348. package/dist/taro-components/{p-b2979101.js → p-bf71dd37.entry.js} +1 -1
  349. package/dist/taro-components/{p-1f517ad8.js → p-bf7ed5a8.entry.js} +1 -1
  350. package/dist/taro-components/p-c27955cc.entry.js +1 -0
  351. package/dist/taro-components/p-c56d7ae1.entry.js +1 -0
  352. package/dist/taro-components/p-c7457e18.entry.js +1 -0
  353. package/dist/taro-components/p-c7e2387f.entry.js +1 -0
  354. package/dist/taro-components/p-c961a230.entry.js +1 -0
  355. package/dist/taro-components/{p-cae824d1.js → p-ca3322c9.entry.js} +1 -1
  356. package/dist/taro-components/p-ced965cb.entry.js +1 -0
  357. package/dist/taro-components/p-d638dd70.entry.js +1 -0
  358. package/dist/taro-components/p-d8a90cf1.entry.js +1 -0
  359. package/dist/taro-components/{p-45c3b3bf.js → p-dc6b5615.entry.js} +1 -1
  360. package/dist/taro-components/p-e13bf240.entry.js +1 -0
  361. package/dist/taro-components/p-e1975260.entry.js +1 -0
  362. package/dist/taro-components/p-e3354af8.entry.js +1 -0
  363. package/dist/taro-components/p-e5615469.entry.js +1 -0
  364. package/dist/taro-components/{p-8d996705.js → p-e62af250.entry.js} +1 -1
  365. package/dist/taro-components/p-e6f1912a.entry.js +1 -0
  366. package/dist/taro-components/p-ea77d5fe.entry.js +1 -0
  367. package/dist/taro-components/p-eb1fe297.entry.js +1 -0
  368. package/dist/taro-components/p-ecd3afe8.entry.js +1 -0
  369. package/dist/taro-components/{p-bd7613d0.js → p-ee17fc14.entry.js} +1 -1
  370. package/dist/taro-components/{p-beae3fe0.js → p-f2fb4988.entry.js} +1 -1
  371. package/dist/taro-components/p-f3de0aa9.entry.js +1 -0
  372. package/dist/taro-components/p-f997a7a2.entry.js +1 -0
  373. package/dist/taro-components/p-fd0a7b45.entry.js +1 -0
  374. package/dist/taro-components/p-ffab09c1.entry.js +1 -0
  375. package/dist/taro-components/taro-components.esm.js +1 -1
  376. package/dist/types/index.d.ts +1 -1
  377. package/package.json +5 -5
  378. package/dist/cjs/ad-6e5e6c21.js +0 -18
  379. package/dist/cjs/ad-custom-03478475.js +0 -18
  380. package/dist/cjs/animation-video-7fc33f99.js +0 -18
  381. package/dist/cjs/animation-view-80fa5d0f.js +0 -18
  382. package/dist/cjs/ar-camera-a5b4fc84.js +0 -18
  383. package/dist/cjs/audio-df2bacdd.js +0 -56
  384. package/dist/cjs/aweme-data-c526f1a1.js +0 -18
  385. package/dist/cjs/block-019beb65.js +0 -14
  386. package/dist/cjs/button-8f729d81.js +0 -73
  387. package/dist/cjs/camera-d82d6f4d.js +0 -18
  388. package/dist/cjs/canvas-5ed991dd.js +0 -49
  389. package/dist/cjs/channel-live-691e20a5.js +0 -18
  390. package/dist/cjs/channel-video-126a3305.js +0 -18
  391. package/dist/cjs/checkbox-ffc9c1a2.js +0 -122
  392. package/dist/cjs/comment-detail-87637299.js +0 -18
  393. package/dist/cjs/comment-list-a18163da.js +0 -18
  394. package/dist/cjs/contact-button-75ae4609.js +0 -18
  395. package/dist/cjs/cover-image-1bf95a9b.js +0 -32
  396. package/dist/cjs/cover-view-a0e4395c.js +0 -65
  397. package/dist/cjs/custom-wrapper-64a8245e.js +0 -14
  398. package/dist/cjs/draggable-sheet-749618d6.js +0 -18
  399. package/dist/cjs/editor-81a773f9.js +0 -18
  400. package/dist/cjs/follow-swan-794e3367.js +0 -18
  401. package/dist/cjs/form-f24b8935.js +0 -141
  402. package/dist/cjs/functional-page-navigator-db0aeeb5.js +0 -18
  403. package/dist/cjs/grid-builder-0757691d.js +0 -18
  404. package/dist/cjs/grid-view-b77da424.js +0 -18
  405. package/dist/cjs/icon-93e7c472.js +0 -30
  406. package/dist/cjs/image-4303ed3a.js +0 -60
  407. package/dist/cjs/inline-payment-panel-0068d0e4.js +0 -18
  408. package/dist/cjs/input-f39a63db.js +0 -213
  409. package/dist/cjs/keyboard-accessory-d7d227b7.js +0 -18
  410. package/dist/cjs/label-e54a79ee.js +0 -15
  411. package/dist/cjs/lifestyle-189b4b3a.js +0 -18
  412. package/dist/cjs/like-b6a72cb7.js +0 -18
  413. package/dist/cjs/list-builder-d7a3f023.js +0 -18
  414. package/dist/cjs/list-view-7cf454c7.js +0 -18
  415. package/dist/cjs/live-player-2115d649.js +0 -18
  416. package/dist/cjs/live-pusher-6a8da38c.js +0 -18
  417. package/dist/cjs/login-cd972083.js +0 -18
  418. package/dist/cjs/lottie-802328ca.js +0 -18
  419. package/dist/cjs/map-841765a9.js +0 -1338
  420. package/dist/cjs/match-media-6e2efc2f.js +0 -18
  421. package/dist/cjs/movable-view-9fa169e1.js +0 -482
  422. package/dist/cjs/native-slot-142506c1.js +0 -18
  423. package/dist/cjs/navigation-bar-b4ff564a.js +0 -18
  424. package/dist/cjs/navigator-43495d4f.js +0 -77
  425. package/dist/cjs/nested-scroll-body-9caab58f.js +0 -18
  426. package/dist/cjs/nested-scroll-header-c5b64f3d.js +0 -18
  427. package/dist/cjs/official-account-f53ef4c9.js +0 -18
  428. package/dist/cjs/open-container-dcb0756e.js +0 -18
  429. package/dist/cjs/open-data-295d2a0f.js +0 -18
  430. package/dist/cjs/page-container-c02ef21e.js +0 -18
  431. package/dist/cjs/page-meta-80a7a861.js +0 -18
  432. package/dist/cjs/picker-0b3ae89d.js +0 -689
  433. package/dist/cjs/picker-view-ee39f2b6.js +0 -179
  434. package/dist/cjs/progress-0434432f.js +0 -39
  435. package/dist/cjs/pull-to-refresh-a7a9d80c.js +0 -269
  436. package/dist/cjs/radio-fa441dee.js +0 -136
  437. package/dist/cjs/rich-text-f88b18dd.js +0 -73
  438. package/dist/cjs/root-portal-849d424f.js +0 -18
  439. package/dist/cjs/rtc-room-e32e8e93.js +0 -18
  440. package/dist/cjs/rtc-room-item-f2696f3e.js +0 -18
  441. package/dist/cjs/script-1d8392d2.js +0 -18
  442. package/dist/cjs/script-2eb2d361.js +0 -18
  443. package/dist/cjs/script-33ab1b9b.js +0 -18
  444. package/dist/cjs/script-66238de4.js +0 -18
  445. package/dist/cjs/script-7d8a337e.js +0 -18
  446. package/dist/cjs/script-9767d763.js +0 -18
  447. package/dist/cjs/script-aa62f496.js +0 -18
  448. package/dist/cjs/script-d39c17ed.js +0 -18
  449. package/dist/cjs/script-d7887902.js +0 -18
  450. package/dist/cjs/scroll-view-65cb8d5f.js +0 -170
  451. package/dist/cjs/share-element-68928fbf.js +0 -18
  452. package/dist/cjs/slider-4093049a.js +0 -163
  453. package/dist/cjs/slot-bb81659e.js +0 -18
  454. package/dist/cjs/snapshot-c2520c58.js +0 -18
  455. package/dist/cjs/span-fb1efcaf.js +0 -18
  456. package/dist/cjs/sticky-header-dcde70ca.js +0 -18
  457. package/dist/cjs/sticky-section-170bc892.js +0 -18
  458. package/dist/cjs/swiper-3ab835bb.js +0 -427
  459. package/dist/cjs/switch-586022a8.js +0 -62
  460. package/dist/cjs/tab-item-cfa3339e.js +0 -18
  461. package/dist/cjs/tabbar-41113df5.js +0 -353
  462. package/dist/cjs/tabs-be7f918d.js +0 -18
  463. package/dist/cjs/text-642f2f48.js +0 -25
  464. package/dist/cjs/textarea-3f14df1c.js +0 -161
  465. package/dist/cjs/video-75aca914.js +0 -748
  466. package/dist/cjs/view-609adfc6.js +0 -70
  467. package/dist/cjs/voip-room-7f55d8a0.js +0 -18
  468. package/dist/cjs/web-view-be5a2d1d.js +0 -27
  469. package/dist/collection/components/ad/index.js +0 -1
  470. package/dist/collection/components/ad-custom/index.js +0 -1
  471. package/dist/collection/components/animation-video/index.js +0 -1
  472. package/dist/collection/components/animation-view/index.js +0 -1
  473. package/dist/collection/components/ar-camera/index.js +0 -1
  474. package/dist/collection/components/audio/index.js +0 -1
  475. package/dist/collection/components/aweme-data/index.js +0 -1
  476. package/dist/collection/components/block/index.js +0 -1
  477. package/dist/collection/components/button/index.js +0 -1
  478. package/dist/collection/components/camera/index.js +0 -1
  479. package/dist/collection/components/canvas/index.js +0 -1
  480. package/dist/collection/components/channel-live/index.js +0 -1
  481. package/dist/collection/components/channel-video/index.js +0 -1
  482. package/dist/collection/components/checkbox/index.js +0 -2
  483. package/dist/collection/components/comment/index.js +0 -2
  484. package/dist/collection/components/contact-button/index.js +0 -1
  485. package/dist/collection/components/cover-image/index.js +0 -1
  486. package/dist/collection/components/cover-view/index.js +0 -1
  487. package/dist/collection/components/custom-wrapper/index.js +0 -1
  488. package/dist/collection/components/double-tap-gesture-handler/index.js +0 -1
  489. package/dist/collection/components/draggable-sheet/index.js +0 -1
  490. package/dist/collection/components/editor/index.js +0 -1
  491. package/dist/collection/components/follow-swan/index.js +0 -1
  492. package/dist/collection/components/force-press-gesture-handler/index.js +0 -1
  493. package/dist/collection/components/form/index.js +0 -1
  494. package/dist/collection/components/functional-page-navigator/index.js +0 -1
  495. package/dist/collection/components/grid-builder/index.js +0 -1
  496. package/dist/collection/components/grid-view/index.js +0 -1
  497. package/dist/collection/components/horizontal-drag-gesture-handler/index.js +0 -1
  498. package/dist/collection/components/icon/index.js +0 -1
  499. package/dist/collection/components/image/index.js +0 -1
  500. package/dist/collection/components/index.js +0 -87
  501. package/dist/collection/components/inline-payment-panel/index.js +0 -1
  502. package/dist/collection/components/input/index.js +0 -1
  503. package/dist/collection/components/keyboard-accessory/index.js +0 -1
  504. package/dist/collection/components/label/index.js +0 -1
  505. package/dist/collection/components/lifestyle/index.js +0 -1
  506. package/dist/collection/components/like/index.js +0 -1
  507. package/dist/collection/components/list-builder/index.js +0 -1
  508. package/dist/collection/components/list-view/index.js +0 -1
  509. package/dist/collection/components/live-player/index.js +0 -1
  510. package/dist/collection/components/live-pusher/index.js +0 -1
  511. package/dist/collection/components/login/index.js +0 -1
  512. package/dist/collection/components/long-press-gesture-handler/index.js +0 -1
  513. package/dist/collection/components/lottie/index.js +0 -1
  514. package/dist/collection/components/map/index.js +0 -1
  515. package/dist/collection/components/match-media/index.js +0 -1
  516. package/dist/collection/components/movable-area/index.js +0 -2
  517. package/dist/collection/components/navigation-bar/index.js +0 -1
  518. package/dist/collection/components/navigator/index.js +0 -1
  519. package/dist/collection/components/nested-scroll-body/index.js +0 -1
  520. package/dist/collection/components/nested-scroll-header/index.js +0 -1
  521. package/dist/collection/components/official-account/index.js +0 -1
  522. package/dist/collection/components/open-container/index.js +0 -1
  523. package/dist/collection/components/open-data/index.js +0 -1
  524. package/dist/collection/components/page-container/index.js +0 -1
  525. package/dist/collection/components/page-meta/index.js +0 -1
  526. package/dist/collection/components/pan-gesture-handler/index.js +0 -1
  527. package/dist/collection/components/picker/index.js +0 -2
  528. package/dist/collection/components/picker-view/index.js +0 -2
  529. package/dist/collection/components/progress/index.js +0 -1
  530. package/dist/collection/components/pull-to-refresh/index.js +0 -1
  531. package/dist/collection/components/radio/index.js +0 -2
  532. package/dist/collection/components/rich-text/index.js +0 -1
  533. package/dist/collection/components/root-portal/index.js +0 -1
  534. package/dist/collection/components/rtc-room/index.js +0 -2
  535. package/dist/collection/components/scale-gesture-handler/index.js +0 -1
  536. package/dist/collection/components/script/index.js +0 -1
  537. package/dist/collection/components/scroll-view/index.js +0 -1
  538. package/dist/collection/components/share-element/index.js +0 -1
  539. package/dist/collection/components/slider/index.js +0 -1
  540. package/dist/collection/components/slot/index.js +0 -2
  541. package/dist/collection/components/snapshot/index.js +0 -1
  542. package/dist/collection/components/span/index.js +0 -1
  543. package/dist/collection/components/sticky-header/index.js +0 -1
  544. package/dist/collection/components/sticky-section/index.js +0 -1
  545. package/dist/collection/components/swiper/index.js +0 -2
  546. package/dist/collection/components/switch/index.js +0 -1
  547. package/dist/collection/components/tabbar/index.js +0 -2
  548. package/dist/collection/components/tabs/index.js +0 -2
  549. package/dist/collection/components/tap-gesture-handler/index.js +0 -1
  550. package/dist/collection/components/text/index.js +0 -1
  551. package/dist/collection/components/textarea/index.js +0 -1
  552. package/dist/collection/components/vertical-drag-gesture-handler/index.js +0 -1
  553. package/dist/collection/components/video/index.js +0 -3
  554. package/dist/collection/components/view/index.js +0 -1
  555. package/dist/collection/components/voip-room/index.js +0 -1
  556. package/dist/collection/components/web-view/index.js +0 -1
  557. package/dist/esm/ad-cfb00041.js +0 -16
  558. package/dist/esm/ad-custom-4a0d4eb2.js +0 -16
  559. package/dist/esm/animation-video-5215c138.js +0 -16
  560. package/dist/esm/animation-view-a07c6ea9.js +0 -16
  561. package/dist/esm/ar-camera-d578c533.js +0 -16
  562. package/dist/esm/audio-fd0e719f.js +0 -54
  563. package/dist/esm/aweme-data-2e12d8c9.js +0 -16
  564. package/dist/esm/block-796aa7d8.js +0 -12
  565. package/dist/esm/button-cd801674.js +0 -71
  566. package/dist/esm/camera-1791b404.js +0 -16
  567. package/dist/esm/canvas-5531b496.js +0 -47
  568. package/dist/esm/channel-live-b63e080a.js +0 -16
  569. package/dist/esm/channel-video-d4ee7254.js +0 -16
  570. package/dist/esm/checkbox-da6b07ea.js +0 -119
  571. package/dist/esm/comment-detail-02a3e8ee.js +0 -16
  572. package/dist/esm/comment-list-a62325be.js +0 -16
  573. package/dist/esm/contact-button-68e95a69.js +0 -16
  574. package/dist/esm/cover-image-0783b2c1.js +0 -30
  575. package/dist/esm/cover-view-8330b60d.js +0 -63
  576. package/dist/esm/custom-wrapper-0bb13a12.js +0 -12
  577. package/dist/esm/draggable-sheet-67355f70.js +0 -16
  578. package/dist/esm/editor-743e35d0.js +0 -16
  579. package/dist/esm/follow-swan-dbdf5cc8.js +0 -16
  580. package/dist/esm/form-576398ba.js +0 -139
  581. package/dist/esm/functional-page-navigator-63f675f4.js +0 -16
  582. package/dist/esm/grid-builder-cf0aa856.js +0 -16
  583. package/dist/esm/grid-view-353586e4.js +0 -16
  584. package/dist/esm/icon-88383f2c.js +0 -28
  585. package/dist/esm/image-b0b222bc.js +0 -58
  586. package/dist/esm/inline-payment-panel-73925dd2.js +0 -16
  587. package/dist/esm/input-4104e3ea.js +0 -211
  588. package/dist/esm/keyboard-accessory-fd485a31.js +0 -16
  589. package/dist/esm/label-94ef4b17.js +0 -13
  590. package/dist/esm/lifestyle-4db11299.js +0 -16
  591. package/dist/esm/like-d61fe792.js +0 -16
  592. package/dist/esm/list-builder-e0d9e871.js +0 -16
  593. package/dist/esm/list-view-84529418.js +0 -16
  594. package/dist/esm/live-player-e4dbe4cf.js +0 -16
  595. package/dist/esm/live-pusher-15c48b78.js +0 -16
  596. package/dist/esm/login-d932daf9.js +0 -16
  597. package/dist/esm/lottie-2ada69b7.js +0 -16
  598. package/dist/esm/map-c6cd24f4.js +0 -1332
  599. package/dist/esm/match-media-2cdc536a.js +0 -16
  600. package/dist/esm/movable-view-c1358d1e.js +0 -479
  601. package/dist/esm/native-slot-98020f54.js +0 -16
  602. package/dist/esm/navigation-bar-eda66236.js +0 -16
  603. package/dist/esm/navigator-65877bda.js +0 -71
  604. package/dist/esm/nested-scroll-body-b1053924.js +0 -16
  605. package/dist/esm/nested-scroll-header-10ba047c.js +0 -16
  606. package/dist/esm/official-account-75c8fa4e.js +0 -16
  607. package/dist/esm/open-container-d288ae08.js +0 -16
  608. package/dist/esm/open-data-9e1673e1.js +0 -16
  609. package/dist/esm/page-container-b5b82c32.js +0 -16
  610. package/dist/esm/page-meta-518b39b7.js +0 -16
  611. package/dist/esm/picker-6a565e02.js +0 -686
  612. package/dist/esm/picker-view-52390656.js +0 -176
  613. package/dist/esm/progress-f99ddb18.js +0 -37
  614. package/dist/esm/pull-to-refresh-e8972159.js +0 -263
  615. package/dist/esm/radio-9b356d76.js +0 -133
  616. package/dist/esm/rich-text-287554f4.js +0 -71
  617. package/dist/esm/root-portal-db801799.js +0 -16
  618. package/dist/esm/rtc-room-bcf23c91.js +0 -16
  619. package/dist/esm/rtc-room-item-052b16d2.js +0 -16
  620. package/dist/esm/script-11e3884a.js +0 -16
  621. package/dist/esm/script-1b22398f.js +0 -16
  622. package/dist/esm/script-1c3855bc.js +0 -16
  623. package/dist/esm/script-4b869172.js +0 -16
  624. package/dist/esm/script-4d587470.js +0 -16
  625. package/dist/esm/script-5c55afcb.js +0 -16
  626. package/dist/esm/script-661db6af.js +0 -16
  627. package/dist/esm/script-76fc8cf5.js +0 -16
  628. package/dist/esm/script-8f332177.js +0 -16
  629. package/dist/esm/scroll-view-43e9acfc.js +0 -168
  630. package/dist/esm/share-element-4f90ad5b.js +0 -16
  631. package/dist/esm/slider-47bbf797.js +0 -161
  632. package/dist/esm/slot-71ad33eb.js +0 -16
  633. package/dist/esm/snapshot-42feea7d.js +0 -16
  634. package/dist/esm/span-d4b171da.js +0 -16
  635. package/dist/esm/sticky-header-a99729bc.js +0 -16
  636. package/dist/esm/sticky-section-f8d75284.js +0 -16
  637. package/dist/esm/swiper-20b19ce0.js +0 -420
  638. package/dist/esm/switch-a538d85e.js +0 -60
  639. package/dist/esm/tab-item-f58dd1b0.js +0 -16
  640. package/dist/esm/tabbar-e6342392.js +0 -345
  641. package/dist/esm/tabs-da838bbd.js +0 -16
  642. package/dist/esm/text-a3b91b23.js +0 -23
  643. package/dist/esm/textarea-c722fd22.js +0 -159
  644. package/dist/esm/video-c663f267.js +0 -720
  645. package/dist/esm/view-965a491b.js +0 -68
  646. package/dist/esm/voip-room-da8085ad.js +0 -16
  647. package/dist/esm/web-view-8f780a19.js +0 -25
  648. package/dist/taro-components/p-00e72620.entry.js +0 -1
  649. package/dist/taro-components/p-03b54b0b.entry.js +0 -1
  650. package/dist/taro-components/p-046319d8.js +0 -1
  651. package/dist/taro-components/p-052dbbd9.entry.js +0 -1
  652. package/dist/taro-components/p-0543d7fe.entry.js +0 -1
  653. package/dist/taro-components/p-06b4ba14.entry.js +0 -1
  654. package/dist/taro-components/p-0741aa7f.entry.js +0 -1
  655. package/dist/taro-components/p-0795a339.entry.js +0 -1
  656. package/dist/taro-components/p-08cfc9f4.js +0 -1
  657. package/dist/taro-components/p-094ba888.entry.js +0 -1
  658. package/dist/taro-components/p-0a92117d.entry.js +0 -1
  659. package/dist/taro-components/p-0ecccbb4.entry.js +0 -1
  660. package/dist/taro-components/p-0f829f27.entry.js +0 -1
  661. package/dist/taro-components/p-127391cb.entry.js +0 -1
  662. package/dist/taro-components/p-137eb06b.js +0 -1
  663. package/dist/taro-components/p-13d455f5.js +0 -1
  664. package/dist/taro-components/p-145ba514.entry.js +0 -1
  665. package/dist/taro-components/p-14795db7.entry.js +0 -1
  666. package/dist/taro-components/p-150a55a3.js +0 -1
  667. package/dist/taro-components/p-168a6355.entry.js +0 -1
  668. package/dist/taro-components/p-1ad94bf6.entry.js +0 -1
  669. package/dist/taro-components/p-1c19d1dd.js +0 -1
  670. package/dist/taro-components/p-1d2b2125.entry.js +0 -1
  671. package/dist/taro-components/p-1d3cfd13.js +0 -1
  672. package/dist/taro-components/p-245fcd36.js +0 -1
  673. package/dist/taro-components/p-2602cd28.entry.js +0 -1
  674. package/dist/taro-components/p-27622761.js +0 -1
  675. package/dist/taro-components/p-2884aec2.js +0 -1
  676. package/dist/taro-components/p-2b8fae1c.entry.js +0 -1
  677. package/dist/taro-components/p-2bf24716.js +0 -1
  678. package/dist/taro-components/p-2c48f6cb.entry.js +0 -1
  679. package/dist/taro-components/p-2e5daff6.js +0 -1
  680. package/dist/taro-components/p-2e841a1d.js +0 -1
  681. package/dist/taro-components/p-2f7b8388.js +0 -1
  682. package/dist/taro-components/p-2f9a4db4.js +0 -1
  683. package/dist/taro-components/p-2ff21d39.entry.js +0 -1
  684. package/dist/taro-components/p-31c75fd5.js +0 -1
  685. package/dist/taro-components/p-31f2f332.entry.js +0 -1
  686. package/dist/taro-components/p-36e83be9.js +0 -1
  687. package/dist/taro-components/p-3837f853.entry.js +0 -1
  688. package/dist/taro-components/p-38598f5b.entry.js +0 -1
  689. package/dist/taro-components/p-3a6ec908.js +0 -1
  690. package/dist/taro-components/p-3d450082.js +0 -1
  691. package/dist/taro-components/p-3f4449b0.entry.js +0 -1
  692. package/dist/taro-components/p-3f650751.entry.js +0 -1
  693. package/dist/taro-components/p-4818a4aa.js +0 -1
  694. package/dist/taro-components/p-496a9932.entry.js +0 -1
  695. package/dist/taro-components/p-49e4d6ae.js +0 -1
  696. package/dist/taro-components/p-4bb83c7d.js +0 -1
  697. package/dist/taro-components/p-4cf49968.js +0 -1
  698. package/dist/taro-components/p-4f4b08df.entry.js +0 -1
  699. package/dist/taro-components/p-50ffadb4.js +0 -1
  700. package/dist/taro-components/p-52c6b16d.js +0 -1
  701. package/dist/taro-components/p-5570a53e.entry.js +0 -1
  702. package/dist/taro-components/p-582a0e0f.entry.js +0 -1
  703. package/dist/taro-components/p-582cbc31.js +0 -1
  704. package/dist/taro-components/p-58a709ad.js +0 -1
  705. package/dist/taro-components/p-5b216b21.entry.js +0 -1
  706. package/dist/taro-components/p-5bd11f73.entry.js +0 -1
  707. package/dist/taro-components/p-5bd1aed9.js +0 -1
  708. package/dist/taro-components/p-5cbc249f.entry.js +0 -1
  709. package/dist/taro-components/p-5ea030de.entry.js +0 -1
  710. package/dist/taro-components/p-5fe2d7cb.js +0 -1
  711. package/dist/taro-components/p-61b23b53.entry.js +0 -1
  712. package/dist/taro-components/p-6223811d.entry.js +0 -1
  713. package/dist/taro-components/p-64a5e7a7.js +0 -1
  714. package/dist/taro-components/p-65c51f07.entry.js +0 -1
  715. package/dist/taro-components/p-680d07ac.js +0 -1
  716. package/dist/taro-components/p-69147844.entry.js +0 -1
  717. package/dist/taro-components/p-6c93b540.js +0 -1
  718. package/dist/taro-components/p-73aae58b.entry.js +0 -1
  719. package/dist/taro-components/p-74ac6c91.entry.js +0 -1
  720. package/dist/taro-components/p-773bed49.entry.js +0 -1
  721. package/dist/taro-components/p-79d3e109.js +0 -1
  722. package/dist/taro-components/p-7bb097de.js +0 -1
  723. package/dist/taro-components/p-7c455a65.entry.js +0 -1
  724. package/dist/taro-components/p-7ea32cac.js +0 -1
  725. package/dist/taro-components/p-806e3c4f.entry.js +0 -1
  726. package/dist/taro-components/p-80fa0c7c.entry.js +0 -1
  727. package/dist/taro-components/p-88048df9.entry.js +0 -1
  728. package/dist/taro-components/p-8837c166.entry.js +0 -1
  729. package/dist/taro-components/p-8b1b513a.js +0 -1
  730. package/dist/taro-components/p-8bc13e66.entry.js +0 -1
  731. package/dist/taro-components/p-8c520f1e.entry.js +0 -1
  732. package/dist/taro-components/p-8d26b600.js +0 -1
  733. package/dist/taro-components/p-8e3bac82.js +0 -1
  734. package/dist/taro-components/p-8f2a4c66.entry.js +0 -1
  735. package/dist/taro-components/p-915aa78c.js +0 -1
  736. package/dist/taro-components/p-922047dd.entry.js +0 -1
  737. package/dist/taro-components/p-92a39ad9.entry.js +0 -1
  738. package/dist/taro-components/p-931bba41.entry.js +0 -1
  739. package/dist/taro-components/p-93e3cefb.js +0 -1
  740. package/dist/taro-components/p-956bc9d5.js +0 -1
  741. package/dist/taro-components/p-9581e63b.entry.js +0 -1
  742. package/dist/taro-components/p-96f65f1d.js +0 -1
  743. package/dist/taro-components/p-975f1b0c.entry.js +0 -1
  744. package/dist/taro-components/p-99383bc2.js +0 -1
  745. package/dist/taro-components/p-99863698.js +0 -1
  746. package/dist/taro-components/p-9a0251c5.entry.js +0 -1
  747. package/dist/taro-components/p-9d4a6732.js +0 -1
  748. package/dist/taro-components/p-9f953e69.entry.js +0 -1
  749. package/dist/taro-components/p-a0ff43d9.entry.js +0 -1
  750. package/dist/taro-components/p-a17695f9.js +0 -1
  751. package/dist/taro-components/p-a293fa24.js +0 -1
  752. package/dist/taro-components/p-a2cb2d73.js +0 -1
  753. package/dist/taro-components/p-a3b266d5.entry.js +0 -1
  754. package/dist/taro-components/p-a5798672.js +0 -1
  755. package/dist/taro-components/p-ab09cecf.entry.js +0 -1
  756. package/dist/taro-components/p-aca7aea1.entry.js +0 -1
  757. package/dist/taro-components/p-ad865966.entry.js +0 -1
  758. package/dist/taro-components/p-ae203a0b.entry.js +0 -1
  759. package/dist/taro-components/p-af5e0304.js +0 -1
  760. package/dist/taro-components/p-b19ea38d.entry.js +0 -1
  761. package/dist/taro-components/p-b70027b2.entry.js +0 -1
  762. package/dist/taro-components/p-b74ad8e4.js +0 -1
  763. package/dist/taro-components/p-b89414d7.entry.js +0 -1
  764. package/dist/taro-components/p-b90499e4.entry.js +0 -1
  765. package/dist/taro-components/p-b9446784.js +0 -1
  766. package/dist/taro-components/p-baed3510.js +0 -1
  767. package/dist/taro-components/p-bcceaa84.entry.js +0 -1
  768. package/dist/taro-components/p-c0687b94.js +0 -1
  769. package/dist/taro-components/p-c09eb36f.entry.js +0 -1
  770. package/dist/taro-components/p-c3a8af99.js +0 -1
  771. package/dist/taro-components/p-c3cf4884.js +0 -1
  772. package/dist/taro-components/p-c3d39813.entry.js +0 -1
  773. package/dist/taro-components/p-c48b7222.js +0 -1
  774. package/dist/taro-components/p-c5666cb2.js +0 -1
  775. package/dist/taro-components/p-c5c71b89.entry.js +0 -1
  776. package/dist/taro-components/p-c66f2363.entry.js +0 -1
  777. package/dist/taro-components/p-c84153ae.entry.js +0 -1
  778. package/dist/taro-components/p-c872ed50.js +0 -1
  779. package/dist/taro-components/p-c9a01a1f.js +0 -1
  780. package/dist/taro-components/p-cb7e1d6e.entry.js +0 -1
  781. package/dist/taro-components/p-cdeebf36.entry.js +0 -1
  782. package/dist/taro-components/p-d11af89d.js +0 -1
  783. package/dist/taro-components/p-d45a75d9.entry.js +0 -1
  784. package/dist/taro-components/p-d5773721.js +0 -1
  785. package/dist/taro-components/p-d5f0d48c.js +0 -1
  786. package/dist/taro-components/p-d6be1ceb.entry.js +0 -1
  787. package/dist/taro-components/p-da4fcba5.js +0 -1
  788. package/dist/taro-components/p-dd0d7e20.js +0 -1
  789. package/dist/taro-components/p-df86c576.entry.js +0 -1
  790. package/dist/taro-components/p-e0de8e35.entry.js +0 -1
  791. package/dist/taro-components/p-e298a2c3.entry.js +0 -1
  792. package/dist/taro-components/p-e3de8581.js +0 -1
  793. package/dist/taro-components/p-e6565988.entry.js +0 -1
  794. package/dist/taro-components/p-e6643dc0.entry.js +0 -1
  795. package/dist/taro-components/p-e87d4a75.entry.js +0 -1
  796. package/dist/taro-components/p-ea5d6d41.entry.js +0 -1
  797. package/dist/taro-components/p-eac9f475.entry.js +0 -1
  798. package/dist/taro-components/p-edab4852.entry.js +0 -1
  799. package/dist/taro-components/p-ee9bae70.js +0 -1
  800. package/dist/taro-components/p-eee2d2f9.entry.js +0 -1
  801. package/dist/taro-components/p-f441b5e7.js +0 -1
  802. package/dist/taro-components/p-f52b25aa.entry.js +0 -1
  803. package/dist/taro-components/p-f57bed55.entry.js +0 -1
  804. package/dist/taro-components/p-f6e5beeb.js +0 -1
  805. package/dist/taro-components/p-fa398c76.entry.js +0 -1
  806. package/dist/taro-components/p-fe1c20a9.entry.js +0 -1
  807. package/dist/taro-components/p-febc484e.js +0 -1
  808. package/dist/taro-components/p-ffcacf9a.entry.js +0 -1
  809. package/dist/taro-components/p-fff1a810.js +0 -1
  810. package/dist/types/components/ad/index.d.ts +0 -1
  811. package/dist/types/components/ad-custom/index.d.ts +0 -1
  812. package/dist/types/components/animation-video/index.d.ts +0 -1
  813. package/dist/types/components/animation-view/index.d.ts +0 -1
  814. package/dist/types/components/ar-camera/index.d.ts +0 -1
  815. package/dist/types/components/audio/index.d.ts +0 -1
  816. package/dist/types/components/aweme-data/index.d.ts +0 -1
  817. package/dist/types/components/block/index.d.ts +0 -1
  818. package/dist/types/components/button/index.d.ts +0 -1
  819. package/dist/types/components/camera/index.d.ts +0 -1
  820. package/dist/types/components/canvas/index.d.ts +0 -1
  821. package/dist/types/components/channel-live/index.d.ts +0 -1
  822. package/dist/types/components/channel-video/index.d.ts +0 -1
  823. package/dist/types/components/checkbox/index.d.ts +0 -2
  824. package/dist/types/components/comment/index.d.ts +0 -2
  825. package/dist/types/components/contact-button/index.d.ts +0 -1
  826. package/dist/types/components/cover-image/index.d.ts +0 -1
  827. package/dist/types/components/cover-view/index.d.ts +0 -1
  828. package/dist/types/components/custom-wrapper/index.d.ts +0 -1
  829. package/dist/types/components/double-tap-gesture-handler/index.d.ts +0 -1
  830. package/dist/types/components/draggable-sheet/index.d.ts +0 -1
  831. package/dist/types/components/editor/index.d.ts +0 -1
  832. package/dist/types/components/follow-swan/index.d.ts +0 -1
  833. package/dist/types/components/force-press-gesture-handler/index.d.ts +0 -1
  834. package/dist/types/components/form/index.d.ts +0 -1
  835. package/dist/types/components/functional-page-navigator/index.d.ts +0 -1
  836. package/dist/types/components/grid-builder/index.d.ts +0 -1
  837. package/dist/types/components/grid-view/index.d.ts +0 -1
  838. package/dist/types/components/horizontal-drag-gesture-handler/index.d.ts +0 -1
  839. package/dist/types/components/icon/index.d.ts +0 -1
  840. package/dist/types/components/image/index.d.ts +0 -1
  841. package/dist/types/components/index.d.ts +0 -87
  842. package/dist/types/components/inline-payment-panel/index.d.ts +0 -1
  843. package/dist/types/components/input/index.d.ts +0 -1
  844. package/dist/types/components/keyboard-accessory/index.d.ts +0 -1
  845. package/dist/types/components/label/index.d.ts +0 -1
  846. package/dist/types/components/lifestyle/index.d.ts +0 -1
  847. package/dist/types/components/like/index.d.ts +0 -1
  848. package/dist/types/components/list-builder/index.d.ts +0 -1
  849. package/dist/types/components/list-view/index.d.ts +0 -1
  850. package/dist/types/components/live-player/index.d.ts +0 -1
  851. package/dist/types/components/live-pusher/index.d.ts +0 -1
  852. package/dist/types/components/login/index.d.ts +0 -1
  853. package/dist/types/components/long-press-gesture-handler/index.d.ts +0 -1
  854. package/dist/types/components/lottie/index.d.ts +0 -1
  855. package/dist/types/components/map/index.d.ts +0 -1
  856. package/dist/types/components/match-media/index.d.ts +0 -1
  857. package/dist/types/components/movable-area/index.d.ts +0 -2
  858. package/dist/types/components/navigation-bar/index.d.ts +0 -1
  859. package/dist/types/components/navigator/index.d.ts +0 -1
  860. package/dist/types/components/nested-scroll-body/index.d.ts +0 -1
  861. package/dist/types/components/nested-scroll-header/index.d.ts +0 -1
  862. package/dist/types/components/official-account/index.d.ts +0 -1
  863. package/dist/types/components/open-container/index.d.ts +0 -1
  864. package/dist/types/components/open-data/index.d.ts +0 -1
  865. package/dist/types/components/page-container/index.d.ts +0 -1
  866. package/dist/types/components/page-meta/index.d.ts +0 -1
  867. package/dist/types/components/pan-gesture-handler/index.d.ts +0 -1
  868. package/dist/types/components/picker/index.d.ts +0 -2
  869. package/dist/types/components/picker-view/index.d.ts +0 -2
  870. package/dist/types/components/progress/index.d.ts +0 -1
  871. package/dist/types/components/pull-to-refresh/index.d.ts +0 -1
  872. package/dist/types/components/radio/index.d.ts +0 -2
  873. package/dist/types/components/rich-text/index.d.ts +0 -1
  874. package/dist/types/components/root-portal/index.d.ts +0 -1
  875. package/dist/types/components/rtc-room/index.d.ts +0 -2
  876. package/dist/types/components/scale-gesture-handler/index.d.ts +0 -1
  877. package/dist/types/components/script/index.d.ts +0 -1
  878. package/dist/types/components/scroll-view/index.d.ts +0 -1
  879. package/dist/types/components/share-element/index.d.ts +0 -1
  880. package/dist/types/components/slider/index.d.ts +0 -1
  881. package/dist/types/components/slot/index.d.ts +0 -2
  882. package/dist/types/components/snapshot/index.d.ts +0 -1
  883. package/dist/types/components/span/index.d.ts +0 -1
  884. package/dist/types/components/sticky-header/index.d.ts +0 -1
  885. package/dist/types/components/sticky-section/index.d.ts +0 -1
  886. package/dist/types/components/swiper/index.d.ts +0 -2
  887. package/dist/types/components/switch/index.d.ts +0 -1
  888. package/dist/types/components/tabbar/index.d.ts +0 -2
  889. package/dist/types/components/tabs/index.d.ts +0 -2
  890. package/dist/types/components/tap-gesture-handler/index.d.ts +0 -1
  891. package/dist/types/components/text/index.d.ts +0 -1
  892. package/dist/types/components/textarea/index.d.ts +0 -1
  893. package/dist/types/components/vertical-drag-gesture-handler/index.d.ts +0 -1
  894. package/dist/types/components/video/index.d.ts +0 -3
  895. package/dist/types/components/view/index.d.ts +0 -1
  896. package/dist/types/components/voip-room/index.d.ts +0 -1
  897. package/dist/types/components/web-view/index.d.ts +0 -1
@@ -2,10 +2,1339 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const map = require('./map-841765a9.js');
6
- require('./index-ae99cbcc.js');
7
- require('hammerjs');
5
+ const index = require('./index-ae99cbcc.js');
6
+ const Hammer = require('hammerjs');
8
7
 
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
10
+ const Hammer__default = /*#__PURE__*/_interopDefaultLegacy(Hammer);
10
11
 
11
- exports.taro_map_core = map.Map;
12
+ const mapCss = ".BMap_cpyCtrl,.anchorBL img,.BMap_bubble_buttons{display:none}";
13
+
14
+ const Map = class {
15
+ constructor(hostRef) {
16
+ index.registerInstance(this, hostRef);
17
+ this.onTap = index.createEvent(this, "tap", 7);
18
+ this.currentRotation = 0;
19
+ /* 获取当前地图中心的经纬度 */
20
+ this._getCenterLocation = (option) => {
21
+ // 遍历当前的覆盖物,找到之前添加的中心点图标并删除它
22
+ this.map.getOverlays().forEach((overlay) => {
23
+ if (overlay instanceof BMapGL.Marker && overlay.isCenterMarker) {
24
+ this.map.removeOverlay(overlay);
25
+ }
26
+ });
27
+ // 创建自定义图标并设置图标位置
28
+ option.iconPath = 'https://img0.baidu.com/it/u=2604176863,3349829508&fm=253&fmt=auto&app=138&f=PNG?w=243&h=243';
29
+ const icon = new BMapGL.Icon(option.iconPath, new BMapGL.Size(20, 30));
30
+ // 将经纬度从BD09转换为GCJ02
31
+ const gcj02Point = [this.longitude, this.latitude];
32
+ const marker = new BMapGL.Marker(new BMapGL.Point(this.longitude, this.latitude), { icon });
33
+ marker.isCenterMarker = true; // 标记该覆盖物是中心点图标
34
+ // 添加新的图标
35
+ this.map.addOverlay(marker);
36
+ return gcj02Point;
37
+ };
38
+ /* 设置定位点图标,支持网络路径、本地路径、代码包路径 */
39
+ this._setLocMarkerIcon = (option) => {
40
+ // 创建自定义图标
41
+ const icon = new BMapGL.Icon(option.iconPath, new BMapGL.Size(20, 30));
42
+ // 创建定位点并设置图标
43
+ const point = new BMapGL.Point(116.404, 39.915);
44
+ const marker = new BMapGL.Marker(point, { icon });
45
+ this.map.addOverlay(marker);
46
+ };
47
+ /* 平移marker,带动画 */
48
+ this._translateMarker = (option) => {
49
+ let latitude = option.destination.latitude;
50
+ const longitude = option.destination.longitude;
51
+ if (latitude < -80 && latitude >= -90) {
52
+ latitude = option.destination.latitude + 10;
53
+ }
54
+ const destinationPoint = new BMapGL.Point(longitude, latitude);
55
+ const obj = {
56
+ flagId: true,
57
+ flagCoordinate: true // 标记是否有有效经纬度
58
+ };
59
+ const animationEndResult = {
60
+ errMsg: 'animationEnd:ok',
61
+ };
62
+ // 获取所有覆盖物
63
+ const overlays = this.map.getOverlays();
64
+ // 查找指定 id 的 Marker 对象
65
+ const targetMarker = overlays.find((overlay) => overlay instanceof BMapGL.Marker && overlay.id === option.markerId);
66
+ if (!targetMarker) {
67
+ console.error(`Marker "${option.markerId}" not found.`);
68
+ obj.flagId = false;
69
+ return obj;
70
+ }
71
+ if (latitude > 90 || latitude < -90 || longitude > 180 || longitude < -180 || isNaN(latitude) || isNaN(longitude)) {
72
+ obj.flagCoordinate = false;
73
+ return obj;
74
+ }
75
+ // 计算平移步长
76
+ const startLngLat = targetMarker.getPosition();
77
+ const step = {
78
+ lng: (destinationPoint.lng - startLngLat.lng) / (option.duration / 16),
79
+ lat: (destinationPoint.lat - startLngLat.lat) / (option.duration / 16), // 每帧移动的纬度增量
80
+ };
81
+ // 计算旋转角度的步长
82
+ const startRotation = targetMarker.getRotation(); // 获取起始旋转角度
83
+ const targetRotation = option.rotate; // 设置目标旋转角度
84
+ if (!this.currentRotation) {
85
+ this.currentRotation = targetRotation;
86
+ }
87
+ else {
88
+ this.currentRotation += targetRotation;
89
+ }
90
+ const rotationStep = (this.currentRotation - startRotation) / (option.duration / 16);
91
+ // 执行平移动画
92
+ let currentLngLat = startLngLat;
93
+ let currentRotation = startRotation;
94
+ if (!option.moveWithRotate && option.autoRotate) {
95
+ let currentFrame = 0; // 用于平移动画的计数器
96
+ // 执行平移动画
97
+ const animationInterval = setInterval(() => {
98
+ currentLngLat = new BMapGL.Point(currentLngLat.lng + step.lng, currentLngLat.lat + step.lat);
99
+ targetMarker.setPosition(currentLngLat);
100
+ currentFrame++;
101
+ if (currentFrame >= option.duration / 16) {
102
+ clearInterval(animationInterval);
103
+ let rotationFrame = 0; // 用于旋转动画的计数器
104
+ // 在到达目的地后执行旋转动画
105
+ const rotationInterval = setInterval(() => {
106
+ currentRotation += rotationStep;
107
+ targetMarker.setRotation(currentRotation);
108
+ rotationFrame++;
109
+ if (rotationFrame >= option.duration / 16) {
110
+ clearInterval(rotationInterval); // 清除旋转动画的定时器
111
+ option === null || option === void 0 ? void 0 : option.animationEnd(animationEndResult);
112
+ }
113
+ }, 16);
114
+ }
115
+ }, 16);
116
+ }
117
+ else if (option.moveWithRotate && option.autoRotate) {
118
+ let currentFrame = 0; // 定义局部变量
119
+ const animationInterval = setInterval(() => {
120
+ currentLngLat = new BMapGL.Point(currentLngLat.lng + step.lng, currentLngLat.lat + step.lat);
121
+ targetMarker.setPosition(currentLngLat);
122
+ currentRotation += rotationStep;
123
+ targetMarker.setRotation(currentRotation);
124
+ currentFrame++;
125
+ if (currentFrame >= option.duration / 16) {
126
+ clearInterval(animationInterval);
127
+ option === null || option === void 0 ? void 0 : option.animationEnd(animationEndResult);
128
+ }
129
+ }, 16);
130
+ }
131
+ else if (option.moveWithRotate && !option.autoRotate) {
132
+ let currentFrame = 0; // 定义局部变量
133
+ const animationInterval = setInterval(() => {
134
+ currentLngLat = new BMapGL.Point(currentLngLat.lng + step.lng, currentLngLat.lat + step.lat);
135
+ targetMarker.setPosition(currentLngLat);
136
+ currentFrame++;
137
+ if (currentFrame >= option.duration / 16) {
138
+ clearInterval(animationInterval);
139
+ option === null || option === void 0 ? void 0 : option.animationEnd(animationEndResult);
140
+ }
141
+ }, 16);
142
+ }
143
+ return obj;
144
+ };
145
+ /* 缩放视野展示所有经纬度 */
146
+ this._includePoints = (option) => {
147
+ const bPoints = option.points.map((point) => new BMapGL.Point(point.longitude, point.latitude));
148
+ const originalZoom = this.map.getZoom();
149
+ const originalCenter = this.map.getCenter();
150
+ const view = this.map.getViewport(bPoints);
151
+ // 地图缩放后
152
+ this.map.centerAndZoom(view.center, view.zoom);
153
+ const bounds = this.map.getBounds();
154
+ let flag = true;
155
+ for (let i = 0; i < bPoints.length; i++) {
156
+ if (!bounds.containsPoint(bPoints[i])) {
157
+ this.map.centerAndZoom(originalCenter, originalZoom);
158
+ flag = false;
159
+ break;
160
+ }
161
+ }
162
+ return flag;
163
+ };
164
+ /* 获取当前地图的视野范围 */
165
+ this._getRegion = () => {
166
+ // 获取地图当前视野范围
167
+ const bounds = this.map.getBounds();
168
+ const sw = bounds.getSouthWest(); // 西南角坐标
169
+ const ne = bounds.getNorthEast(); // 东北角坐标
170
+ return {
171
+ southwest: { lat: sw.lat, lng: sw.lng },
172
+ northeast: { lat: ne.lat, lng: ne.lng },
173
+ };
174
+ };
175
+ /* 获取当前地图的旋转角 */
176
+ this._getRotate = () => {
177
+ // 获取地图当前旋转角度
178
+ let rotation = this.rotate;
179
+ if (rotation < 0 || rotation > 360) {
180
+ rotation = 0;
181
+ }
182
+ return rotation;
183
+ };
184
+ /* 获取当前地图的倾斜角 */
185
+ this._getSkew = () => {
186
+ let Skew = this.skew;
187
+ if (Skew < 0 || Skew > 40) {
188
+ Skew = 0;
189
+ }
190
+ return Skew;
191
+ };
192
+ /* 获取当前地图的缩放级别 */
193
+ this._getScale = () => {
194
+ const Scale = this.scale;
195
+ return Scale;
196
+ };
197
+ /* 设置地图中心点偏移,向后向下为增长 */
198
+ this._setCenterOffset = (option) => {
199
+ // 解构获取偏移量参数
200
+ const [x, y] = option.offset;
201
+ // 获取地图尺寸
202
+ const mapSize = this.map.getSize();
203
+ // 计算水平偏移量
204
+ const offsetX = Math.max(0.25 * mapSize.width, Math.min(0.75 * mapSize.width, x * mapSize.width));
205
+ // 计算垂直偏移量
206
+ const offsetY = Math.max(0.25 * mapSize.height, Math.min(0.75 * mapSize.height, y * mapSize.height));
207
+ // 创建像素坐标对象
208
+ const pixel = new BMapGL.Pixel(offsetX, offsetY);
209
+ // 将像素坐标转换为地理坐标
210
+ const center = this.map.pixelToPoint(pixel);
211
+ // 平移地图至指定中心点
212
+ this.map.panTo(center);
213
+ };
214
+ /* 添加 marker */
215
+ this._addMarkers = (option) => {
216
+ if (option.clear) {
217
+ // 清除地图上所有marker
218
+ this.map.clearOverlays(this.markers);
219
+ }
220
+ option.markers.forEach((marker) => {
221
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
222
+ if (marker.latitude && marker.longitude && marker.iconPath) {
223
+ const pt = new BMapGL.Point(marker.longitude, marker.latitude);
224
+ const markerObj = new BMapGL.Marker(pt, { enableClicking: true });
225
+ this.map.addOverlay(markerObj);
226
+ markerObj.id = marker.id; // 设置标记点的唯一标识符
227
+ markerObj.alpha = marker.alpha;
228
+ if (marker.zIndex) {
229
+ markerObj.setZIndex(marker.zIndex);
230
+ }
231
+ if (marker.width && marker.height && marker.iconPath) {
232
+ const icon = new BMapGL.Icon(marker.iconPath, new BMapGL.Size(marker.width, marker.height));
233
+ markerObj.setIcon(icon);
234
+ }
235
+ else if (marker.iconPath) {
236
+ const img = new Image();
237
+ img.src = marker.iconPath;
238
+ img.style.opacity = String(marker.alpha);
239
+ img.onload = () => {
240
+ const iconSize = new BMapGL.Size(img.width, img.height);
241
+ const icon = new BMapGL.Icon(img.src, iconSize);
242
+ icon.imageOffset = new BMapGL.Size(0, 0, marker.alpha || 1);
243
+ markerObj.setIcon(icon);
244
+ };
245
+ }
246
+ else {
247
+ console.error('没有找到iconPath图片路径');
248
+ return;
249
+ }
250
+ const rotate = marker.rotate ? marker.rotate : 0;
251
+ if (rotate) {
252
+ markerObj.setRotation(rotate);
253
+ }
254
+ if (marker.anchor) {
255
+ const offsetX = ((_b = (_a = marker.anchor) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0) * (marker.width || 0);
256
+ const offsetY = ((_d = (_c = marker.anchor) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0) * (marker.height || 0);
257
+ markerObj.setOffset(new BMapGL.Size(offsetX, offsetY));
258
+ }
259
+ // 创建title
260
+ if (!marker.callout && marker.title) {
261
+ const hammer = new Hammer__default['default'](this.mapRef); // 创建Hammer对象,绑定到地图容器
262
+ hammer.on('tap', (e) => {
263
+ // 使用tap事件替代click事件
264
+ const touch = e.center;
265
+ const x = touch.x;
266
+ const y = touch.y;
267
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
268
+ const threshold = 15;
269
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
270
+ option.markers.forEach((marker) => {
271
+ // 通过class名获取地图容器
272
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
273
+ // 获取地图容器在屏幕上的偏移量
274
+ const mapContainerRect = mapContainer.getBoundingClientRect();
275
+ const mapOffsetX = mapContainerRect.left;
276
+ const mapOffsetY = mapContainerRect.top;
277
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
278
+ const pixel = this.map.pointToPixel(point);
279
+ const markerX = pixel.x + mapOffsetX;
280
+ const markerY = pixel.y + mapOffsetY;
281
+ // 计算触摸位置与标记点的距离
282
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
283
+ if (distance < threshold && marker.id === markerObj.id) {
284
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
285
+ const content = `<div style="text-align:center">${marker.title}</div>`;
286
+ const infoWindow = new BMapGL.InfoWindow(content);
287
+ this.map.openInfoWindow(infoWindow, pt);
288
+ }
289
+ });
290
+ });
291
+ }
292
+ if (marker.callout) {
293
+ const offsetX = ((_e = marker.callout) === null || _e === void 0 ? void 0 : _e.anchorX) ? (_f = marker.callout) === null || _f === void 0 ? void 0 : _f.anchorX : 0; // 横向偏移量
294
+ const offsetY = ((_g = marker.callout) === null || _g === void 0 ? void 0 : _g.anchorY) ? (_h = marker.callout) === null || _h === void 0 ? void 0 : _h.anchorY : 0; // 纵向偏移量
295
+ // 创建气泡(callout)对象
296
+ const callout = new BMapGL.InfoWindow(`<div style="
297
+ padding: ${(_j = marker.callout) === null || _j === void 0 ? void 0 : _j.padding}px;
298
+ color:${(_k = marker.callout) === null || _k === void 0 ? void 0 : _k.color};
299
+ text-align:${(_l = marker.callout) === null || _l === void 0 ? void 0 : _l.textAlign};"
300
+ >
301
+ <p style="font-size:${(_m = marker.callout) === null || _m === void 0 ? void 0 : _m.fontSize}px">${((_o = marker.callout) === null || _o === void 0 ? void 0 : _o.content) || ''}</p>
302
+ </div>`, {
303
+ width: 200,
304
+ height: 100,
305
+ offset: new BMapGL.Size(offsetX - 24, offsetY - 20), // 设置偏移量
306
+ });
307
+ // 自定义属性存储气泡(callout)对象
308
+ markerObj.callout = callout;
309
+ // 将气泡(callout)对象绑定到标记(marker)对象上
310
+ this.map.addOverlay(markerObj);
311
+ if (((_p = marker.callout) === null || _p === void 0 ? void 0 : _p.display) === 'ALWAYS') {
312
+ markerObj.callout.disableCloseOnClick();
313
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
314
+ markerObj.callout.addEventListener('open', function () {
315
+ var _a, _b, _c, _d;
316
+ console.log(markerObj.callout);
317
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
318
+ if (infoWindowElement) {
319
+ let triangle = infoWindowElement.querySelector('.triangle');
320
+ if (!triangle) {
321
+ // 如果不存在,则创建并添加新的三角形 div
322
+ triangle = document.createElement('div');
323
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
324
+ infoWindowElement.appendChild(triangle);
325
+ }
326
+ const img = document.querySelector('.BMap_bubble_pop>img');
327
+ if (img) {
328
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
329
+ }
330
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
331
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
332
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
333
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
334
+ // 确保边框大小不超过15
335
+ borderWidth = Math.min(borderWidth, 15);
336
+ triangle.setAttribute('style', `width:0;height:0;border-left:${borderWidth}px solid transparent;border-right:${borderWidth}px solid transparent;border-top:${borderWidth}px solid ${borderColor};position:absolute;left:83px;bottom:-${2 * borderWidth}px`);
337
+ infoWindowElement.setAttribute('style', `background-color:${backgroundcolor};top:${point.lat - 120}px; left:${point.lng - 100}px;position: absolute;border: ${borderWidth}px solid ${borderColor};border-radius:${borderRadius}px; `);
338
+ }
339
+ });
340
+ this.map.openInfoWindow(markerObj.callout, pt);
341
+ }
342
+ else {
343
+ const hammer = new Hammer__default['default'](this.mapRef); // 创建Hammer对象,绑定到地图容器
344
+ hammer.on('tap', (e) => {
345
+ // 使用tap事件替代click事件
346
+ const touch = e.center;
347
+ const x = touch.x;
348
+ const y = touch.y;
349
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
350
+ const threshold = 15;
351
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
352
+ option.markers.forEach((marker) => {
353
+ // 通过class名获取地图容器
354
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
355
+ // 获取地图容器在屏幕上的偏移量
356
+ const mapContainerRect = mapContainer.getBoundingClientRect();
357
+ const mapOffsetX = mapContainerRect.left;
358
+ const mapOffsetY = mapContainerRect.top;
359
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
360
+ const pixel = this.map.pointToPixel(point);
361
+ const markerX = pixel.x + mapOffsetX;
362
+ const markerY = pixel.y + mapOffsetY;
363
+ // 计算触摸位置与标记点的距离
364
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
365
+ if (distance < threshold && marker.id === markerObj.id) {
366
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
367
+ markerObj.callout.addEventListener('open', function () {
368
+ var _a, _b, _c, _d;
369
+ console.log(markerObj.callout);
370
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
371
+ if (infoWindowElement) {
372
+ let triangle = infoWindowElement.querySelector('.triangle');
373
+ if (!triangle) {
374
+ // 如果不存在,则创建并添加新的三角形 div
375
+ triangle = document.createElement('div');
376
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
377
+ infoWindowElement.appendChild(triangle);
378
+ }
379
+ const img = document.querySelector('.BMap_bubble_pop>img');
380
+ if (img) {
381
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
382
+ }
383
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
384
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
385
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
386
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
387
+ // 确保边框大小不超过15
388
+ borderWidth = Math.min(borderWidth, 15);
389
+ triangle.setAttribute('style', `width:0;height:0;border-left:${borderWidth}px solid transparent;border-right:${borderWidth}px solid transparent;border-top:${borderWidth}px solid ${borderColor};position:absolute;left:83px;bottom:-${2 * borderWidth}px`);
390
+ infoWindowElement.setAttribute('style', `background-color:${backgroundcolor};top:${point.lat - 120}px; left:${point.lng - 100}px;position: absolute;border: ${borderWidth}px solid ${borderColor};border-radius:${borderRadius}px; `);
391
+ }
392
+ });
393
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
394
+ this.map.openInfoWindow(markerObj.callout, pt);
395
+ }
396
+ else {
397
+ markerObj.callout.enableCloseOnClick();
398
+ // 用户点击到了地图上的其他位置,不是标记点
399
+ }
400
+ });
401
+ });
402
+ }
403
+ }
404
+ // 判断是否有label属性
405
+ if (marker.label) {
406
+ const labelContent = marker.label.content || '';
407
+ const labelOpts = {
408
+ position: pt,
409
+ offset: new BMapGL.Size(marker.label.anchorX || 0, marker.label.anchorY || 0),
410
+ };
411
+ const label = new BMapGL.Label(labelContent, labelOpts);
412
+ // 设置标签样式
413
+ label.setStyle({
414
+ color: marker.label.color,
415
+ fontSize: marker.label.fontSize + 'px',
416
+ borderWidth: marker.label.borderWidth + 'px',
417
+ borderColor: marker.label.borderColor,
418
+ borderRadius: marker.label.borderRadius + 'px',
419
+ background: marker.label.bgColor,
420
+ padding: marker.label.padding + 'px',
421
+ });
422
+ markerObj.setLabel(label);
423
+ }
424
+ }
425
+ });
426
+ };
427
+ /* 移除 marker */
428
+ this._removeMarkers = (option) => {
429
+ // 获取所有覆盖物
430
+ const overlays = this.map.getOverlays();
431
+ let newTargetMarker = {};
432
+ option.markerIds.forEach((id) => {
433
+ // 查找指定 id 的 Marker 对象
434
+ const targetMarker = overlays.find((overlay) => overlay instanceof BMapGL.Marker && String(overlay.id) === id);
435
+ newTargetMarker = targetMarker;
436
+ this.map.removeOverlay(targetMarker);
437
+ });
438
+ return newTargetMarker;
439
+ };
440
+ /* 沿指定路径移动 marker,用于轨迹回放等场景。动画完成时触发回调事件,若动画进行中,对同一 marker 再次调用 moveAlong 方法,前一次的动画将被打断 */
441
+ this._moveAlong = (object) => {
442
+ const path = object.path;
443
+ const targetMarkerId = object.markerId;
444
+ const duration = object.duration;
445
+ const autoRotate = object.autoRotate;
446
+ const targetMarker = this.map.getOverlays().find((overlay) => overlay instanceof BMapGL.Marker && overlay.id === targetMarkerId);
447
+ const points = path.map((p) => new BMapGL.Point(p.longitude, p.latitude));
448
+ const obj = {
449
+ flagId: true,
450
+ flagCoordinate: true // 标记是否有有效经纬度
451
+ };
452
+ if (!targetMarker) {
453
+ console.error(`Marker "${targetMarkerId}" not found.`);
454
+ obj.flagId = false;
455
+ return obj;
456
+ }
457
+ for (let i = 0; i < points.length; i++) {
458
+ const point = points[i];
459
+ if (point.lat < -80 && point.lat >= -90) {
460
+ point.lat += 10;
461
+ }
462
+ if (point.lng < -180 || point.lng > 180 || point.lat < -90 || point.lat > 90 || isNaN(point.lng) || isNaN(point.lat)) {
463
+ obj.flagCoordinate = false;
464
+ return obj;
465
+ }
466
+ }
467
+ if (obj.flagId && obj.flagCoordinate) {
468
+ const startTime = performance.now();
469
+ const animate = (timestamp) => {
470
+ const elapsedTime = timestamp - startTime;
471
+ const progress = Math.min(elapsedTime / duration, 1);
472
+ const currentPoint = this.getPointOnPath(points, progress);
473
+ targetMarker.setPosition(currentPoint);
474
+ if (autoRotate && progress < 1) {
475
+ const nextPoint = this.getPointOnPath(points, Math.min(progress + 0.01, 1)); // 获取前进一点的点
476
+ const rotation = this.calculateRotation(currentPoint, nextPoint);
477
+ targetMarker.setRotation(rotation);
478
+ }
479
+ if (progress < 1) {
480
+ requestAnimationFrame(animate);
481
+ }
482
+ else {
483
+ // 动画结束
484
+ targetMarker.setPosition(points[points.length - 1]); // 设置 marker 位置为路径的最后一个点
485
+ targetMarker.setRotation(0); // 恢复旋转角度为0
486
+ }
487
+ };
488
+ requestAnimationFrame(animate);
489
+ }
490
+ return obj;
491
+ };
492
+ this.getPointOnPath = (points, progress) => {
493
+ const totalLength = this.calculateTotalLength(points);
494
+ const targetLength = totalLength * progress;
495
+ let currentLength = 0;
496
+ for (let i = 0; i < points.length - 1; i++) {
497
+ const segmentLength = this.map.getDistance(points[i], points[i + 1]);
498
+ if (currentLength + segmentLength >= targetLength) {
499
+ const ratio = (targetLength - currentLength) / segmentLength;
500
+ const deltaX = points[i + 1].lng - points[i].lng;
501
+ const deltaY = points[i + 1].lat - points[i].lat;
502
+ const newLng = points[i].lng + deltaX * ratio;
503
+ const newLat = points[i].lat + deltaY * ratio;
504
+ return new BMapGL.Point(newLng, newLat);
505
+ }
506
+ currentLength += segmentLength;
507
+ }
508
+ // 如果进度超出路径长度,返回路径的最后一个点
509
+ return points[points.length - 1];
510
+ };
511
+ this.calculateTotalLength = (points) => {
512
+ let totalLength = 0;
513
+ for (let i = 0; i < points.length - 1; i++) {
514
+ totalLength += this.map.getDistance(points[i], points[i + 1]);
515
+ }
516
+ return totalLength;
517
+ };
518
+ this.calculateRotation = (currentPoint, nextPoint) => {
519
+ const dx = nextPoint.lng - currentPoint.lng;
520
+ const dy = nextPoint.lat - currentPoint.lat;
521
+ let angle = Math.atan2(dy, dx) * (180 / Math.PI);
522
+ angle = 90 - angle;
523
+ return angle;
524
+ };
525
+ /* 创建自定义图片图层,图片会随着地图缩放而缩放 */
526
+ this._addGroundOverlay = (option) => {
527
+ const { src, opacity, bounds, visible, id, zIndex } = option;
528
+ let flag = true;
529
+ if (bounds.southwest.longitude >= bounds.northeast.longitude || bounds.southwest.latitude >= bounds.northeast.latitude) {
530
+ flag = false;
531
+ return;
532
+ }
533
+ if (bounds.southwest.latitude > 90 || bounds.southwest.latitude < -90 || bounds.southwest.longitude > 180 || bounds.southwest.longitude < -180 || isNaN(bounds.southwest.latitude) || isNaN(bounds.southwest.longitude)) {
534
+ flag = false;
535
+ return;
536
+ }
537
+ if (bounds.northeast.latitude > 90 || bounds.northeast.latitude < -90 || bounds.northeast.longitude > 180 || bounds.northeast.longitude < -180 || isNaN(bounds.northeast.latitude) || isNaN(bounds.northeast.longitude)) {
538
+ flag = false;
539
+ return;
540
+ }
541
+ // 创建覆盖物边界对象
542
+ const overlayBounds = new BMapGL.Bounds(new BMapGL.Point(bounds.southwest.longitude, bounds.southwest.latitude), new BMapGL.Point(bounds.northeast.longitude, bounds.northeast.latitude));
543
+ // 定义 GroundOverlay类
544
+ function GroundOverlay(bounds, imageUrl, map, visible, opacity, zIndex, id) {
545
+ this._bounds = bounds;
546
+ this._imageUrl = imageUrl;
547
+ this._map = map;
548
+ this._visible = visible;
549
+ this._opacity = opacity;
550
+ this._zIndex = zIndex;
551
+ this._id = id;
552
+ }
553
+ // 继承 BMapGL.Overlay
554
+ GroundOverlay.prototype = new BMapGL.Overlay();
555
+ // 初始化方法
556
+ GroundOverlay.prototype.initialize = function (map) {
557
+ // 移除已存在的元素
558
+ if (document.getElementById(this._id)) {
559
+ const element = document.getElementById(this._id);
560
+ element === null || element === void 0 ? void 0 : element.remove();
561
+ }
562
+ this._map = map;
563
+ if (!this._div) {
564
+ // 创建 div 元素并设置样式
565
+ const div = document.createElement('div');
566
+ div.id = this._id;
567
+ div.style.position = 'absolute';
568
+ div.style.border = 'none';
569
+ div.style.zIndex = this._zIndex;
570
+ // 创建 img 元素并设置样式
571
+ const img = document.createElement('img');
572
+ img.src = this._imageUrl;
573
+ // 确保opacity值在0到1之间
574
+ const validOpacity = (this._opacity < 0) ? '1' : this._opacity;
575
+ img.style.opacity = validOpacity;
576
+ div.appendChild(img);
577
+ this._div = div;
578
+ }
579
+ // 监听地图缩放事件,调整覆盖物尺寸
580
+ map.addEventListener('zoomend', () => {
581
+ const swPixel = map.pointToOverlayPixel(this._bounds.getSouthWest());
582
+ const nePixel = map.pointToOverlayPixel(this._bounds.getNorthEast());
583
+ const width = nePixel.x - swPixel.x;
584
+ const height = swPixel.y - nePixel.y;
585
+ this._div.style.width = width + 'px';
586
+ this._div.style.height = height + 'px';
587
+ const img = this._div.querySelector('img');
588
+ img.style.width = width + 'px';
589
+ img.style.height = height + 'px';
590
+ });
591
+ // 将 div 元素添加到地图覆盖物层
592
+ map.getPanes().labelPane.appendChild(this._div);
593
+ return this._div;
594
+ };
595
+ // 绘制方法
596
+ GroundOverlay.prototype.draw = function () {
597
+ // 设置 div 元素位置和尺寸
598
+ const _northeast = {
599
+ lat: option.bounds.northeast.latitude,
600
+ lng: option.bounds.southwest.longitude
601
+ };
602
+ const position = this._map.pointToOverlayPixel(_northeast);
603
+ this._div.style.left = position.x + 'px';
604
+ this._div.style.top = position.y + 'px';
605
+ const bounds = this._map.getBounds();
606
+ const sw = this._map.pointToPixel(bounds.getSouthWest());
607
+ const ne = this._map.pointToPixel(bounds.getNorthEast());
608
+ const width = ne.x - sw.x;
609
+ const height = ne.y - sw.y;
610
+ const zoom = this._map.getZoom();
611
+ const imageWidth = width * Math.pow(2, 18 - zoom);
612
+ const imageHeight = height * Math.pow(2, 18 - zoom);
613
+ this._div.style.width = imageWidth + 'px';
614
+ this._div.style.height = imageHeight + 'px';
615
+ this._div.style.display = this._visible ? 'block' : 'none';
616
+ const validOpacity = (this._opacity < 0) ? '1' : this._opacity;
617
+ this._div.getElementsByTagName('img')[0].style.opacity = validOpacity;
618
+ };
619
+ // 创建 GroundOverlay 实例
620
+ const overlay = new GroundOverlay(overlayBounds, src, this.map, visible, opacity, zIndex, id);
621
+ this.map.addOverlay(overlay);
622
+ // 对所有覆盖物进行排序
623
+ const overlays = this.map.getOverlays().sort((a, b) => a._zIndex - b._zIndex);
624
+ this.groundOverlay = overlay;
625
+ // 将所有覆盖物重新绘制
626
+ overlays.forEach((overlay) => overlay.draw());
627
+ const zoom = this.map.getZoom();
628
+ if (zoom < 20) {
629
+ this.map.setZoom(zoom + 1);
630
+ this.map.setZoom(zoom);
631
+ }
632
+ else {
633
+ this.map.setZoom(zoom - 1);
634
+ this.map.setZoom(zoom);
635
+ }
636
+ return flag;
637
+ };
638
+ /* 更新自定义图片图层 */
639
+ this._updateGroundOverlay = (option) => {
640
+ const { src, opacity, bounds, visible, id, zIndex } = option;
641
+ let obj;
642
+ let flagId = true; // 标记是否有id
643
+ let flagCoordinate = true; // 标记是否有有效经纬度
644
+ let flagObj = {};
645
+ // 获取所有图层
646
+ const overlays = this.map.getOverlays();
647
+ // 找到要更新的图层
648
+ const targetOverlay = overlays.find((overlay) => overlay._id === id);
649
+ if (!targetOverlay) {
650
+ flagId = false;
651
+ flagObj = {
652
+ flagId: flagId,
653
+ flagCoordinate: flagCoordinate
654
+ };
655
+ obj = Object.assign({}, flagObj);
656
+ return obj;
657
+ }
658
+ if (bounds.southwest.longitude >= bounds.northeast.longitude || bounds.southwest.latitude >= bounds.northeast.latitude) {
659
+ flagCoordinate = false;
660
+ flagObj = {
661
+ flagId: flagId,
662
+ flagCoordinate: flagCoordinate
663
+ };
664
+ obj = Object.assign({}, flagObj);
665
+ }
666
+ if (bounds.southwest.latitude > 90 || bounds.southwest.latitude < -90 || bounds.southwest.longitude > 180 || bounds.southwest.longitude < -180 || isNaN(bounds.southwest.latitude) || isNaN(bounds.southwest.longitude)) {
667
+ flagCoordinate = false;
668
+ flagObj = {
669
+ flagId: flagId,
670
+ flagCoordinate: flagCoordinate
671
+ };
672
+ obj = Object.assign({}, flagObj);
673
+ }
674
+ if (bounds.northeast.latitude > 90 || bounds.northeast.latitude < -90 || bounds.northeast.longitude > 180 || bounds.northeast.longitude < -180 || isNaN(bounds.northeast.latitude) || isNaN(bounds.northeast.longitude)) {
675
+ flagCoordinate = false;
676
+ flagObj = {
677
+ flagId: flagId,
678
+ flagCoordinate: flagCoordinate
679
+ };
680
+ obj = Object.assign({}, flagObj);
681
+ }
682
+ if (flagId && flagCoordinate) {
683
+ const targetBounds = new BMapGL.Bounds(new BMapGL.Point(bounds.southwest.longitude, bounds.southwest.latitude), new BMapGL.Point(bounds.northeast.longitude, bounds.northeast.latitude));
684
+ const zoom = this.map.getZoom();
685
+ if (targetOverlay) {
686
+ // 更新DOM元素
687
+ const element = document.getElementById(id);
688
+ if (element) {
689
+ const imgElement = element.querySelector('img');
690
+ if (imgElement) {
691
+ // 找到了对应的元素
692
+ const validOpacity = (opacity < 0) ? '1' : opacity;
693
+ element.style.opacity = validOpacity;
694
+ imgElement.style.display = visible ? 'block' : 'none';
695
+ element.style.zIndex = zIndex;
696
+ // 加载图片
697
+ const image = new Image();
698
+ image.onload = () => {
699
+ // 图片加载完成后执行
700
+ imgElement.src = src; // 设置图片的src
701
+ // 根据当前缩放级别设置图片宽高
702
+ const lngSpan = targetBounds.getNorthEast().lng - targetBounds.getSouthWest().lng;
703
+ const mapWidth = this.map.getSize().width; // 获取地图容器的宽度
704
+ const updatedImageWidth = (mapWidth / Math.pow(2, 18 - zoom)) * lngSpan;
705
+ const imageAspectRatio = image.naturalHeight / image.naturalWidth;
706
+ const updatedImageHeight = updatedImageWidth * imageAspectRatio;
707
+ imgElement.style.width = `${updatedImageWidth}px`;
708
+ imgElement.style.height = `${updatedImageHeight}px`;
709
+ // 重新绘制图层
710
+ targetOverlay._bounds = targetBounds;
711
+ targetOverlay.draw();
712
+ // 更新完图片后,立即重绘地图
713
+ this.map.panTo(this.map.getCenter());
714
+ targetOverlay.draw();
715
+ };
716
+ image.src = src;
717
+ }
718
+ }
719
+ }
720
+ else {
721
+ // 没有找到对应的元素
722
+ console.error(`未找到id为${id}的元素`);
723
+ }
724
+ flagObj = {
725
+ flagId: flagId,
726
+ flagCoordinate: flagCoordinate
727
+ };
728
+ obj = Object.assign({}, flagObj);
729
+ return obj;
730
+ }
731
+ else {
732
+ return obj;
733
+ }
734
+ };
735
+ /* 移除自定义图片图层 */
736
+ this._removeGroundOverlay = (option) => {
737
+ // 获取所有图层
738
+ const overlays = this.map.getOverlays();
739
+ let newTargetOverlay = '';
740
+ // 找到要更新的图层
741
+ const targetOverlay = overlays.find((overlay) => overlay._id === option.id);
742
+ newTargetOverlay = targetOverlay;
743
+ if (targetOverlay) {
744
+ // 如果找到了对应的图层,执行删除操作
745
+ this.map.removeOverlay(targetOverlay);
746
+ }
747
+ return newTargetOverlay;
748
+ };
749
+ /* 限制地图的显示范围。此接口同时会限制地图的最小缩放整数级别。 */
750
+ this._setBoundary = (option) => {
751
+ let nth = option.northeast.latitude;
752
+ let sth = option.southwest.latitude;
753
+ let flag = true;
754
+ if (option.northeast.latitude <= -80 && option.northeast.latitude >= -90) {
755
+ nth = option.northeast.latitude + 10;
756
+ }
757
+ if (option.southwest.latitude <= -80 && option.southwest.latitude >= -90) {
758
+ sth = option.southwest.latitude + 10;
759
+ }
760
+ if (option.northeast.latitude < -90 || option.northeast.latitude > 90 || option.northeast.longitude < -180 || option.northeast.longitude > 180 || isNaN(option.northeast.latitude) || isNaN(option.northeast.longitude) || option.northeast.longitude < option.southwest.longitude || option.northeast.latitude < option.southwest.latitude) {
761
+ flag = false;
762
+ return;
763
+ }
764
+ if (option.southwest.latitude < -90 || option.southwest.latitude > 90 || option.southwest.longitude < -180 || option.southwest.longitude > 180 || isNaN(option.southwest.latitude) || isNaN(option.southwest.longitude)) {
765
+ flag = false;
766
+ return;
767
+ }
768
+ const ne = new BMapGL.Point(option.northeast.longitude, nth);
769
+ const sw = new BMapGL.Point(option.southwest.longitude, sth);
770
+ const bounds = new BMapGL.Bounds(sw, ne);
771
+ const viewport = this.map.getViewport([ne, sw]);
772
+ this.map.centerAndZoom(new BMapGL.Point(viewport.center.lng, viewport.center.lat), viewport.zoom + 2);
773
+ this.map.addOverlay(new BMapGL.Polygon([
774
+ new BMapGL.Point(bounds.sw.lng, bounds.sw.lat),
775
+ new BMapGL.Point(bounds.sw.lng, bounds.ne.lat),
776
+ new BMapGL.Point(bounds.ne.lng, bounds.ne.lat),
777
+ new BMapGL.Point(bounds.ne.lng, bounds.sw.lat)
778
+ ], {
779
+ fillOpacity: 0
780
+ }));
781
+ BMapGLLib.AreaRestriction.setBounds(this.map, bounds);
782
+ return flag;
783
+ };
784
+ this.latitude = undefined;
785
+ this.longitude = undefined;
786
+ this.scale = undefined;
787
+ this.minScale = undefined;
788
+ this.maxScale = undefined;
789
+ this.markers = undefined;
790
+ this.polyline = undefined;
791
+ this.circles = undefined;
792
+ this.polygons = undefined;
793
+ this.subkey = undefined;
794
+ this.layerStyle = undefined;
795
+ this.rotate = undefined;
796
+ this.skew = undefined;
797
+ this.showCompass = undefined;
798
+ this.showScale = undefined;
799
+ this.enableOverlooking = undefined;
800
+ this.enableZoom = undefined;
801
+ this.enableScroll = undefined;
802
+ this.enableRotate = undefined;
803
+ this.enableSatellite = undefined;
804
+ this.enableTraffic = undefined;
805
+ this.enableBuilding = undefined;
806
+ this.enableAutoMaxOverlooking = undefined;
807
+ this.enable3D = undefined;
808
+ this.width = '100%';
809
+ this.height = '100%';
810
+ }
811
+ async componentDidLoad() {
812
+ // 加载地图脚本
813
+ await this.loadMapScript();
814
+ // 记载BmapLib工具库
815
+ await this.LoadBmapLibScript();
816
+ // 如果容器元素存在
817
+ if (this.mapRef) {
818
+ this.mapRef.addEventListener('touchmove', (e) => {
819
+ if (e.cancelable) {
820
+ e.preventDefault();
821
+ }
822
+ });
823
+ // 创建地图对象
824
+ this.map = new BMapGL.Map(this.mapRef);
825
+ // 移除百度地图版权信息
826
+ this.map.removeControl(this.map.getMapType());
827
+ // 创建中心点坐标对象
828
+ // 中心经纬度为必填值
829
+ if (this.latitude < -90 || this.latitude > 90 || this.longitude < -180 || this.longitude > 180 || isNaN(this.latitude) || isNaN(this.longitude)) {
830
+ console.error('请正确设置中心经纬度');
831
+ return;
832
+ }
833
+ let scale = isNaN(this.scale) ? 16 : this.scale;
834
+ let minScale = isNaN(this.minScale) ? 3 : this.minScale;
835
+ let maxScale = isNaN(this.maxScale) ? 16 : this.maxScale;
836
+ const point = new BMapGL.Point(this.longitude, this.latitude);
837
+ if (minScale < 3 || minScale > 20) {
838
+ minScale = 3;
839
+ this.map.setMinZoom(3);
840
+ }
841
+ else {
842
+ // 设置最小缩放级别
843
+ this.map.setMinZoom(minScale);
844
+ }
845
+ if (maxScale > 20 || maxScale < 3) {
846
+ maxScale = 20;
847
+ this.map.setMaxZoom(20);
848
+ }
849
+ else {
850
+ // 设置最大缩放级别
851
+ this.map.setMaxZoom(maxScale);
852
+ }
853
+ if (minScale > maxScale) {
854
+ minScale = 3;
855
+ this.map.setMinZoom(3);
856
+ maxScale = 20;
857
+ this.map.setMaxZoom(20);
858
+ }
859
+ // 设置地图中心和缩放级别
860
+ if (minScale <= 16 && maxScale >= 16) {
861
+ if (scale >= minScale && scale <= maxScale) {
862
+ // 使用this.scale来设置缩放级别
863
+ this.map.centerAndZoom(point, scale);
864
+ }
865
+ else {
866
+ scale = 16;
867
+ this.map.centerAndZoom(point, scale);
868
+ }
869
+ }
870
+ else {
871
+ if (scale >= minScale && scale <= maxScale) {
872
+ // 使用this.scale来设置缩放级别
873
+ this.map.centerAndZoom(point, scale);
874
+ }
875
+ else if (scale < minScale) {
876
+ scale = minScale;
877
+ this.map.centerAndZoom(point, minScale);
878
+ }
879
+ else {
880
+ scale = maxScale;
881
+ this.map.centerAndZoom(point, maxScale);
882
+ }
883
+ }
884
+ // 添加标记点markers
885
+ if (Array.isArray(this.markers)) {
886
+ this.addMarkers(this.markers);
887
+ }
888
+ // 创建polyline路线
889
+ if (Array.isArray(this.polyline)) {
890
+ this.polyline.forEach((line) => {
891
+ if (line.points) {
892
+ const points = line.points.map((point) => new BMapGL.Point(point.longitude, point.latitude));
893
+ const polyline = new BMapGL.Polyline(points, {
894
+ strokeColor: line.color,
895
+ strokeWeight: line.width,
896
+ strokeStyle: line.dottedLine ? 'dashed' : 'solid',
897
+ strokeOpacity: 1,
898
+ });
899
+ // 将polyline路线添加到地图上
900
+ this.map.addOverlay(polyline);
901
+ }
902
+ });
903
+ }
904
+ // 添加圆形覆盖物circles
905
+ if (Array.isArray(this.circles)) {
906
+ this.circles.forEach((circle) => {
907
+ if (circle.latitude && circle.longitude && circle.radius) {
908
+ const point = new BMapGL.Point(circle.longitude, circle.latitude);
909
+ const circleObj = new BMapGL.Circle(point, circle.radius, {
910
+ strokeColor: circle.color,
911
+ fillColor: circle.fillColor,
912
+ strokeWeight: circle.strokeWidth,
913
+ });
914
+ this.map.addOverlay(circleObj);
915
+ }
916
+ });
917
+ }
918
+ // 多边形
919
+ if (Array.isArray(this.polygons)) {
920
+ this.polygons.forEach((polygon) => {
921
+ // 创建多边形的点坐标数组
922
+ const points = polygon.points.map((point) => new BMapGL.Point(point.longitude, point.latitude));
923
+ // 创建多边形对象
924
+ const polygonObj = new BMapGL.Polygon(points, {
925
+ strokeColor: polygon.strokeColor,
926
+ fillColor: polygon.fillColor,
927
+ strokeWeight: polygon.strokeWidth,
928
+ });
929
+ // 将多边形添加到地图上
930
+ this.map.addOverlay(polygonObj);
931
+ });
932
+ }
933
+ if (this.layerStyle === 0) {
934
+ const layerStyle = this.layerStyle;
935
+ if (layerStyle) {
936
+ // 使用个性化地图样式
937
+ this.map.setMapStyleV2({ styleId: this.subkey });
938
+ }
939
+ }
940
+ else {
941
+ const layerStyle = this.layerStyle ? this.layerStyle : 1;
942
+ if (layerStyle === 1) {
943
+ // 使用个性化地图样式
944
+ this.map.setMapStyleV2({ styleId: this.subkey });
945
+ }
946
+ }
947
+ const enable3D = this.enable3D === true ? this.enable3D : false;
948
+ const enableOverlooking = this.enableOverlooking === true ? this.enableOverlooking : false;
949
+ const enableAutoMaxOverlooking = this.enableAutoMaxOverlooking === true ? this.enableAutoMaxOverlooking : false;
950
+ const skew = this.skew ? this.skew : 0;
951
+ if (enable3D === true) {
952
+ if (enableOverlooking === true) {
953
+ // /开启最大俯视角
954
+ if (enableAutoMaxOverlooking === true) {
955
+ this.map.setTilt(75);
956
+ }
957
+ else {
958
+ // 开启俯视角度
959
+ this.map.setTilt(45);
960
+ }
961
+ }
962
+ else if (skew >= 0 && skew <= 40) {
963
+ // 设置倾斜角度
964
+ this.map.setTilt(skew);
965
+ }
966
+ else {
967
+ this.map.setTilt(0);
968
+ }
969
+ }
970
+ else {
971
+ this.map.setTilt(0);
972
+ }
973
+ // 显示指南针
974
+ const showCompass = this.showCompass === true ? this.showCompass : false;
975
+ if (showCompass === true) {
976
+ const compassControl = new BMapGL.NavigationControl3D({
977
+ anchor: BMAP_ANCHOR_TOP_RIGHT,
978
+ type: 3, // 3代表显示指南针
979
+ });
980
+ this.map.addControl(compassControl);
981
+ }
982
+ // 显示比例尺
983
+ const showScale = this.showScale === true ? this.showScale : false;
984
+ if (showScale === true) {
985
+ const scaleControl = new BMapGL.ScaleControl({
986
+ anchor: BMAP_ANCHOR_BOTTOM_RIGHT,
987
+ });
988
+ this.map.addControl(scaleControl);
989
+ }
990
+ const enableZoom = this.enableZoom === false ? this.enableZoom : true;
991
+ if (enableZoom === true) {
992
+ // 启用缩放
993
+ this.map.enableScrollWheelZoom(this.enableZoom);
994
+ }
995
+ // 启用缩放
996
+ if (this.enableZoom === true && this.mapRef) {
997
+ this.map.enablePinchToZoom();
998
+ }
999
+ else {
1000
+ this.map.disablePinchToZoom();
1001
+ }
1002
+ // 拖拽
1003
+ const enableScroll = this.enableScroll === false ? this.enableScroll : true;
1004
+ if (enableScroll === true) {
1005
+ this.map.enableDragging();
1006
+ }
1007
+ else {
1008
+ this.map.disableDragging();
1009
+ }
1010
+ const rotate = this.rotate ? this.rotate : 0;
1011
+ if (rotate >= 0 && this.rotate <= 360) {
1012
+ this.map.setHeading(this.rotate);
1013
+ }
1014
+ else {
1015
+ this.map.setHeading(0);
1016
+ }
1017
+ // 设置旋转角度
1018
+ if (this.enableRotate === true) {
1019
+ this.map.enableRotateGestures();
1020
+ }
1021
+ // 启用卫星图
1022
+ const enableSatellite = this.enableSatellite === true ? this.enableSatellite : false;
1023
+ if (enableSatellite === true && this.mapRef) {
1024
+ const mapTypeControl = new BMapGL.MapTypeControl({
1025
+ mapTypes: [BMAP_NORMAL_MAP, BMAP_SATELLITE_MAP],
1026
+ });
1027
+ this.map.addControl(mapTypeControl);
1028
+ }
1029
+ const enableTraffic = this.enableTraffic === true ? this.enableTraffic : false;
1030
+ if (enableTraffic === true && this.mapRef) {
1031
+ this.map.setTrafficOn();
1032
+ }
1033
+ // 是否开启建筑物
1034
+ const enableBuilding = this.enableBuilding === false ? this.enableBuilding : true;
1035
+ if (enableBuilding === false) {
1036
+ this.map.setDisplayOptions({ building: false });
1037
+ }
1038
+ }
1039
+ if (this.map) {
1040
+ // 创建Hammer对象,绑定到地图容器
1041
+ const hammer = new Hammer__default['default'](this.mapRef);
1042
+ hammer.on('tap', (e) => {
1043
+ // 将Hammer事件对象中的坐标转换为百度地图坐标
1044
+ const point = this.map.pixelToPoint({ x: e.center.x, y: e.center.y });
1045
+ this.onTap.emit({
1046
+ longitude: point.lng,
1047
+ latitude: point.lat,
1048
+ });
1049
+ });
1050
+ }
1051
+ }
1052
+ disconnectedCallback() {
1053
+ if (this.map) {
1054
+ this.map.destroy();
1055
+ }
1056
+ }
1057
+ addMarkers(markers) {
1058
+ // 维护已存在的marker id 列表
1059
+ const existingIds = [];
1060
+ markers.forEach((marker) => {
1061
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1062
+ if (existingIds.includes(marker.id)) {
1063
+ // 如果id已存在,直接返回,不执行后续操作
1064
+ console.error('请输入不同的marker的id');
1065
+ return;
1066
+ }
1067
+ existingIds.push(marker.id);
1068
+ if (marker.latitude && marker.longitude && marker.iconPath && marker.id) {
1069
+ if (marker.latitude < -90 || marker.latitude > 90 || marker.longitude < -180 || marker.longitude > 180) {
1070
+ console.error('请正确设置marker的经纬度');
1071
+ return;
1072
+ }
1073
+ const pt = new BMapGL.Point(marker.longitude, marker.latitude);
1074
+ const markerObj = new BMapGL.Marker(pt, { enableClicking: true });
1075
+ markerObj.id = marker.id; // 设置标记点的唯一标识符
1076
+ markerObj.alpha = marker.alpha;
1077
+ if (marker.zIndex) {
1078
+ markerObj.setZIndex(marker.zIndex);
1079
+ }
1080
+ if (marker.width && marker.height) {
1081
+ const canvas = document.createElement('canvas');
1082
+ canvas.width = marker.width * 2;
1083
+ canvas.height = marker.height * 2;
1084
+ // 获取 Canvas 上下文
1085
+ const ctx = canvas.getContext('2d');
1086
+ // 创建一个新的图片对象
1087
+ const img = new Image();
1088
+ // 设置图片的跨域属性
1089
+ img.crossOrigin = 'Anonymous';
1090
+ img.src = marker.iconPath;
1091
+ // 当图片加载完成后,将其绘制到Canvas上
1092
+ img.onload = function () {
1093
+ ctx.drawImage(img, 0, 0, marker.width * 2, marker.height * 2);
1094
+ // 创建 BMapGL.Icon 对象,并将 Canvas 元素作为图标的内容
1095
+ // 设置锚点偏移量为(0, 0),表示图标的左上角将与经纬度对齐
1096
+ const icon = new BMapGL.Icon(canvas.toDataURL(), new BMapGL.Size(marker.width, marker.height), {
1097
+ anchor: new BMapGL.Size(0, 0)
1098
+ });
1099
+ markerObj.setIcon(icon);
1100
+ };
1101
+ }
1102
+ else {
1103
+ const img = new Image();
1104
+ img.src = marker.iconPath;
1105
+ img.style.opacity = String(marker.alpha);
1106
+ img.onload = () => {
1107
+ const iconSize = new BMapGL.Size(img.width, img.height);
1108
+ const icon = new BMapGL.Icon(img.src, iconSize);
1109
+ icon.imageOffset = new BMapGL.Size(0, 0, marker.alpha || 1);
1110
+ markerObj.setIcon(icon);
1111
+ };
1112
+ }
1113
+ const rotate = marker.rotate ? marker.rotate : 0;
1114
+ if (rotate >= 0 && rotate <= 360) {
1115
+ markerObj.setRotation(rotate);
1116
+ }
1117
+ // 如果anchor.x和anchor.y被定义,则使用它们的值,否则使用默认值
1118
+ const anchorX = (_b = (_a = marker.anchor) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0.5;
1119
+ const anchorY = (_d = (_c = marker.anchor) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 1;
1120
+ if (anchorX >= 0 && anchorX <= 1 && anchorY >= 0 && anchorY <= 1) {
1121
+ // 锚点设置为图标宽度的负值乘以x,以向左移动
1122
+ const offsetX = -(anchorX) * (marker.width || 0);
1123
+ // 锚点设置为图标高度的负值乘以y,以向上移动
1124
+ const offsetY = -(anchorY) * (marker.height || 0);
1125
+ // 使用计算出的偏移量设置标注对象的偏移
1126
+ markerObj.setOffset(new BMapGL.Size(offsetX, offsetY));
1127
+ }
1128
+ else {
1129
+ const offsetX = -0.5 * (marker.width || 0);
1130
+ const offsetY = -1 * (marker.height || 0);
1131
+ markerObj.setOffset(new BMapGL.Size(offsetX, offsetY));
1132
+ }
1133
+ // 创建title
1134
+ if (!marker.callout && marker.title) {
1135
+ const hammer = new Hammer__default['default'](this.mapRef); // 创建Hammer对象,绑定到地图容器
1136
+ hammer.on('tap', (e) => {
1137
+ // 使用tap事件替代click事件
1138
+ const touch = e.center;
1139
+ const x = touch.x;
1140
+ const y = touch.y;
1141
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
1142
+ const threshold = 15;
1143
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
1144
+ this.markers.forEach((marker) => {
1145
+ // 通过class名获取地图容器
1146
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
1147
+ // 获取地图容器在屏幕上的偏移量
1148
+ const mapContainerRect = mapContainer.getBoundingClientRect();
1149
+ const mapOffsetX = mapContainerRect.left;
1150
+ const mapOffsetY = mapContainerRect.top;
1151
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
1152
+ const pixel = this.map.pointToPixel(point);
1153
+ const markerX = pixel.x + mapOffsetX;
1154
+ const markerY = pixel.y + mapOffsetY;
1155
+ // 计算触摸位置与标记点的距离
1156
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
1157
+ if (distance < threshold && marker.id === markerObj.id) {
1158
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
1159
+ const content = `<div style="text-align:center">${marker.title}</div>`;
1160
+ const infoWindow = new BMapGL.InfoWindow(content);
1161
+ this.map.openInfoWindow(infoWindow, pt);
1162
+ }
1163
+ });
1164
+ });
1165
+ }
1166
+ if (marker.callout) {
1167
+ const offsetX = ((_e = marker.callout) === null || _e === void 0 ? void 0 : _e.anchorX) ? (_f = marker.callout) === null || _f === void 0 ? void 0 : _f.anchorX : 0; // 横向偏移量
1168
+ const offsetY = ((_g = marker.callout) === null || _g === void 0 ? void 0 : _g.anchorY) ? (_h = marker.callout) === null || _h === void 0 ? void 0 : _h.anchorY : 0; // 纵向偏移量
1169
+ // 创建气泡(callout)对象
1170
+ const callout = new BMapGL.InfoWindow(`<div style="
1171
+ padding: ${(_j = marker.callout) === null || _j === void 0 ? void 0 : _j.padding}px;
1172
+ color:${(_k = marker.callout) === null || _k === void 0 ? void 0 : _k.color};
1173
+ text-align:${(_l = marker.callout) === null || _l === void 0 ? void 0 : _l.textAlign};"
1174
+ >
1175
+ <p style="font-size:${(_m = marker.callout) === null || _m === void 0 ? void 0 : _m.fontSize}px">${((_o = marker.callout) === null || _o === void 0 ? void 0 : _o.content) || ''}</p>
1176
+ </div>`, {
1177
+ width: 200,
1178
+ height: 100,
1179
+ offset: new BMapGL.Size(offsetX - 24, offsetY - 20), // 设置偏移量
1180
+ });
1181
+ // 自定义属性存储气泡(callout)对象
1182
+ markerObj.callout = callout;
1183
+ // 将气泡(callout)对象绑定到标记(marker)对象上
1184
+ this.map.addOverlay(markerObj);
1185
+ if (((_p = marker.callout) === null || _p === void 0 ? void 0 : _p.display) === 'ALWAYS') {
1186
+ markerObj.callout.disableCloseOnClick();
1187
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
1188
+ markerObj.callout.addEventListener('open', function () {
1189
+ var _a, _b, _c, _d;
1190
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
1191
+ if (infoWindowElement) {
1192
+ let triangle = infoWindowElement.querySelector('.triangle');
1193
+ if (!triangle) {
1194
+ // 如果不存在,则创建并添加新的三角形 div
1195
+ triangle = document.createElement('div');
1196
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
1197
+ infoWindowElement.appendChild(triangle);
1198
+ }
1199
+ const img = document.querySelector('.BMap_bubble_pop>img');
1200
+ if (img) {
1201
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
1202
+ }
1203
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
1204
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
1205
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
1206
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
1207
+ // 确保边框大小不超过15
1208
+ borderWidth = Math.min(borderWidth, 15);
1209
+ triangle.setAttribute('style', `width:0;height:0;borderLeft:${borderWidth}px solid transparent;borderRight:${borderWidth}px solid transparent;borderTop:${borderWidth}px solid ${borderColor};position:absolute;left:83px;bottom:-${2 * borderWidth}px`);
1210
+ infoWindowElement.setAttribute('style', `background-color:${backgroundcolor};top:${point.lat - 120}px; left:${point.lng - 100}px;position: absolute;border: ${borderWidth}px solid ${borderColor};border-radius:${borderRadius}px; `);
1211
+ }
1212
+ });
1213
+ this.map.openInfoWindow(markerObj.callout, pt);
1214
+ }
1215
+ else {
1216
+ const hammer = new Hammer__default['default'](this.mapRef); // 创建Hammer对象,绑定到地图容器
1217
+ hammer.on('tap', (e) => {
1218
+ // 使用tap事件替代click事件
1219
+ const touch = e.center;
1220
+ const x = touch.x;
1221
+ const y = touch.y;
1222
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
1223
+ const threshold = 15;
1224
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
1225
+ this.markers.forEach((marker) => {
1226
+ // 通过class名获取地图容器
1227
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
1228
+ // 获取地图容器在屏幕上的偏移量
1229
+ const mapContainerRect = mapContainer.getBoundingClientRect();
1230
+ const mapOffsetX = mapContainerRect.left;
1231
+ const mapOffsetY = mapContainerRect.top;
1232
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
1233
+ const pixel = this.map.pointToPixel(point);
1234
+ const markerX = pixel.x + mapOffsetX;
1235
+ const markerY = pixel.y + mapOffsetY;
1236
+ // 计算触摸位置与标记点的距离
1237
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
1238
+ if (distance < threshold && marker.id === markerObj.id) {
1239
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
1240
+ markerObj.callout.addEventListener('open', function () {
1241
+ var _a, _b, _c, _d;
1242
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
1243
+ if (infoWindowElement) {
1244
+ let triangle = infoWindowElement.querySelector('.triangle');
1245
+ if (!triangle) {
1246
+ // 如果不存在,则创建并添加新的三角形 div
1247
+ triangle = document.createElement('div');
1248
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
1249
+ infoWindowElement.appendChild(triangle);
1250
+ }
1251
+ const img = document.querySelector('.BMap_bubble_pop>img');
1252
+ if (img) {
1253
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
1254
+ }
1255
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
1256
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
1257
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
1258
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
1259
+ // 确保边框大小不超过15
1260
+ borderWidth = Math.min(borderWidth, 15);
1261
+ triangle.setAttribute('style', `width:0;height:0;border-left:${borderWidth}px solid transparent;border-right:${borderWidth}px solid transparent;border-top:${borderWidth}px solid ${borderColor};position:absolute;left:83px;bottom:-${2 * borderWidth}px`);
1262
+ infoWindowElement.setAttribute('style', `background-color:${backgroundcolor};top:${point.lat - 120}px; left:${point.lng - 100}px;position: absolute;border: ${borderWidth}px solid ${borderColor};border-radius:${borderRadius}px; `);
1263
+ }
1264
+ });
1265
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
1266
+ this.map.openInfoWindow(markerObj.callout, pt);
1267
+ }
1268
+ else {
1269
+ markerObj.callout.enableCloseOnClick();
1270
+ // 用户点击到了地图上的其他位置,不是标记点
1271
+ }
1272
+ });
1273
+ });
1274
+ }
1275
+ }
1276
+ // 判断是否有label属性
1277
+ if (marker.label) {
1278
+ const labelContent = marker.label.content || '';
1279
+ const labelOpts = {
1280
+ position: pt,
1281
+ offset: new BMapGL.Size(marker.label.anchorX || 0, marker.label.anchorY || 0),
1282
+ };
1283
+ const label = new BMapGL.Label(labelContent, labelOpts);
1284
+ const borderColor = marker.label.borderColor ? marker.label.borderColor : 'white';
1285
+ // 设置标签样式
1286
+ label.setStyle({
1287
+ color: marker.label.color,
1288
+ fontSize: marker.label.fontSize + 'px',
1289
+ borderWidth: marker.label.borderWidth + 'px',
1290
+ borderColor: borderColor,
1291
+ borderRadius: marker.label.borderRadius + 'px',
1292
+ background: marker.label.bgColor,
1293
+ padding: marker.label.padding + 'px',
1294
+ });
1295
+ markerObj.setLabel(label);
1296
+ }
1297
+ this.map.addOverlay(markerObj);
1298
+ }
1299
+ else {
1300
+ console.error('请检查marker经纬度和marker自定义图标路径和id值');
1301
+ }
1302
+ });
1303
+ }
1304
+ loadMapScript() {
1305
+ return new Promise((resolve, reject) => {
1306
+ const script = document.createElement('script');
1307
+ script.src = 'https://api.map.baidu.com/getscript?v=3.0&type=webgl&ak=Mb1FLBD3gfnY6bup4v6zEWh6MXwsZ9eo';
1308
+ script.defer = true;
1309
+ script.onload = () => resolve();
1310
+ script.onerror = reject;
1311
+ script.type = 'text/javascript';
1312
+ document.head.appendChild(script);
1313
+ });
1314
+ }
1315
+ async LoadBmapLibScript() {
1316
+ return new Promise((resolve, reject) => {
1317
+ // 地图加载完成后再加载BMapGLLib
1318
+ const bmapLibScript = document.createElement('script');
1319
+ bmapLibScript.src = '//mapopen.bj.bcebos.com/github/BMapGLLib/AreaRestriction/src/AreaRestriction.min.js';
1320
+ bmapLibScript.defer = true;
1321
+ bmapLibScript.type = 'text/javascript';
1322
+ bmapLibScript.onload = () => {
1323
+ resolve();
1324
+ };
1325
+ bmapLibScript.onerror = reject;
1326
+ document.head.appendChild(bmapLibScript);
1327
+ });
1328
+ }
1329
+ render() {
1330
+ return (index.h(index.Host, null, index.h("div", { id: "mapContainer", ref: (dom) => {
1331
+ if (dom) {
1332
+ this.mapRef = dom;
1333
+ }
1334
+ }, style: { width: this.width, height: this.height } })));
1335
+ }
1336
+ get el() { return index.getElement(this); }
1337
+ };
1338
+ Map.style = mapCss;
1339
+
1340
+ exports.taro_map_core = Map;