@tarojs/components 4.1.5 → 4.1.6-beta.1

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