@tarojs/components 4.0.0-canary.9 → 4.0.0

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 (695) hide show
  1. package/LICENSE +8 -8
  2. package/README.md +1 -1
  3. package/dist/cjs/{index-dbbe9dde.js → index-09efe07d.js} +208 -5
  4. package/dist/cjs/{index-dfd8638f.js → index-8a70c333.js} +6 -0
  5. package/dist/cjs/{index-f6805218.js → index-b873e40f.js} +45 -27
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/taro-ad-core.cjs.entry.js +1 -1
  8. package/dist/cjs/taro-ad-custom-core.cjs.entry.js +1 -1
  9. package/dist/cjs/taro-animation-video-core.cjs.entry.js +1 -1
  10. package/dist/cjs/taro-animation-view-core.cjs.entry.js +1 -1
  11. package/dist/cjs/taro-ar-camera-core.cjs.entry.js +1 -1
  12. package/dist/cjs/taro-audio-core.cjs.entry.js +1 -1
  13. package/dist/cjs/taro-aweme-data-core.cjs.entry.js +1 -1
  14. package/dist/cjs/taro-block-core.cjs.entry.js +1 -1
  15. package/dist/cjs/taro-button-core.cjs.entry.js +2 -2
  16. package/dist/cjs/taro-camera-core.cjs.entry.js +1 -1
  17. package/dist/cjs/taro-canvas-core.cjs.entry.js +1 -1
  18. package/dist/cjs/taro-channel-live-core.cjs.entry.js +1 -1
  19. package/dist/cjs/taro-channel-video-core.cjs.entry.js +1 -1
  20. package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +1 -1
  21. package/dist/cjs/taro-comment-detail-core.cjs.entry.js +1 -1
  22. package/dist/cjs/taro-comment-list-core.cjs.entry.js +1 -1
  23. package/dist/cjs/taro-components.cjs.js +2 -2
  24. package/dist/cjs/taro-contact-button-core.cjs.entry.js +1 -1
  25. package/dist/cjs/taro-cover-image-core.cjs.entry.js +1 -1
  26. package/dist/cjs/taro-cover-view-core.cjs.entry.js +2 -2
  27. package/dist/cjs/taro-custom-wrapper-core.cjs.entry.js +1 -1
  28. package/dist/cjs/taro-draggable-sheet-core.cjs.entry.js +21 -0
  29. package/dist/cjs/taro-editor-core.cjs.entry.js +1 -1
  30. package/dist/cjs/taro-follow-swan-core.cjs.entry.js +1 -1
  31. package/dist/cjs/taro-form-core.cjs.entry.js +1 -1
  32. package/dist/cjs/taro-functional-page-navigator-core.cjs.entry.js +1 -1
  33. package/dist/cjs/taro-grid-builder-core.cjs.entry.js +21 -0
  34. package/dist/cjs/taro-grid-view-core.cjs.entry.js +1 -1
  35. package/dist/cjs/taro-icon-core.cjs.entry.js +2 -2
  36. package/dist/cjs/taro-image-core.cjs.entry.js +2 -2
  37. package/dist/cjs/taro-inline-payment-panel-core.cjs.entry.js +1 -1
  38. package/dist/cjs/taro-input-core.cjs.entry.js +2 -2
  39. package/dist/cjs/taro-keyboard-accessory-core.cjs.entry.js +1 -1
  40. package/dist/cjs/taro-label-core.cjs.entry.js +1 -1
  41. package/dist/cjs/taro-lifestyle-core.cjs.entry.js +1 -1
  42. package/dist/cjs/taro-like-core.cjs.entry.js +1 -1
  43. package/dist/cjs/taro-list-builder-core.cjs.entry.js +21 -0
  44. package/dist/cjs/taro-list-view-core.cjs.entry.js +1 -1
  45. package/dist/cjs/taro-live-player-core.cjs.entry.js +1 -1
  46. package/dist/cjs/taro-live-pusher-core.cjs.entry.js +1 -1
  47. package/dist/cjs/taro-login-core.cjs.entry.js +1 -1
  48. package/dist/cjs/taro-lottie-core.cjs.entry.js +1 -1
  49. package/dist/cjs/taro-map-core.cjs.entry.js +1325 -6
  50. package/dist/cjs/taro-match-media-core.cjs.entry.js +1 -1
  51. package/dist/cjs/taro-movable-area-core_2.cjs.entry.js +6 -3
  52. package/dist/cjs/taro-native-slot-core.cjs.entry.js +1 -1
  53. package/dist/cjs/taro-navigation-bar-core.cjs.entry.js +1 -1
  54. package/dist/cjs/taro-navigator-core.cjs.entry.js +2 -2
  55. package/dist/cjs/taro-nested-scroll-body-core.cjs.entry.js +21 -0
  56. package/dist/cjs/taro-nested-scroll-header-core.cjs.entry.js +21 -0
  57. package/dist/cjs/taro-official-account-core.cjs.entry.js +1 -1
  58. package/dist/cjs/taro-open-container-core.cjs.entry.js +21 -0
  59. package/dist/cjs/taro-open-data-core.cjs.entry.js +1 -1
  60. package/dist/cjs/taro-page-container-core.cjs.entry.js +1 -1
  61. package/dist/cjs/taro-page-meta-core.cjs.entry.js +1 -1
  62. package/dist/cjs/taro-picker-core_2.cjs.entry.js +2 -2
  63. package/dist/cjs/taro-picker-view-column-core_2.cjs.entry.js +3 -3
  64. package/dist/cjs/taro-progress-core.cjs.entry.js +2 -2
  65. package/dist/cjs/taro-pull-to-refresh-core.cjs.entry.js +5 -2
  66. package/dist/cjs/taro-radio-core_2.cjs.entry.js +1 -1
  67. package/dist/cjs/taro-rich-text-core.cjs.entry.js +1 -1
  68. package/dist/cjs/taro-root-portal-core.cjs.entry.js +1 -1
  69. package/dist/cjs/taro-rtc-room-core.cjs.entry.js +1 -1
  70. package/dist/cjs/taro-rtc-room-item-core.cjs.entry.js +1 -1
  71. package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
  72. package/dist/cjs/taro-share-element-core.cjs.entry.js +1 -1
  73. package/dist/cjs/taro-slider-core.cjs.entry.js +1 -1
  74. package/dist/cjs/taro-slot-core.cjs.entry.js +1 -1
  75. package/dist/cjs/taro-snapshot-core.cjs.entry.js +1 -1
  76. package/dist/cjs/taro-span-core.cjs.entry.js +21 -0
  77. package/dist/cjs/taro-sticky-header-core.cjs.entry.js +1 -1
  78. package/dist/cjs/taro-sticky-section-core.cjs.entry.js +1 -1
  79. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +42 -8
  80. package/dist/cjs/taro-switch-core.cjs.entry.js +1 -1
  81. package/dist/cjs/taro-tab-item-core.cjs.entry.js +1 -1
  82. package/dist/cjs/taro-tabbar.cjs.entry.js +4 -4
  83. package/dist/cjs/taro-tabs-core.cjs.entry.js +1 -1
  84. package/dist/cjs/taro-text-core.cjs.entry.js +1 -1
  85. package/dist/cjs/taro-textarea-core.cjs.entry.js +1 -1
  86. package/dist/cjs/taro-video-control_3.cjs.entry.js +15 -6
  87. package/dist/cjs/taro-view-core.cjs.entry.js +3 -3
  88. package/dist/cjs/taro-voip-room-core.cjs.entry.js +1 -1
  89. package/dist/cjs/taro-web-view-core.cjs.entry.js +1 -1
  90. package/dist/collection/collection-manifest.json +7 -0
  91. package/dist/collection/components/draggable-sheet/draggable-sheet.js +11 -0
  92. package/dist/collection/components/grid-builder/grid-builder.js +11 -0
  93. package/dist/collection/components/input/style/index.css +1 -1
  94. package/dist/collection/components/list-builder/list-builder.js +11 -0
  95. package/dist/collection/components/map/map.js +1806 -4
  96. package/dist/collection/components/map/style/map.css +1 -0
  97. package/dist/collection/components/movable-area/movable-area.js +2 -1
  98. package/dist/collection/components/movable-area/movable-view.js +3 -1
  99. package/dist/collection/components/nested-scroll-body/nested-scroll-body.js +11 -0
  100. package/dist/collection/components/nested-scroll-header/nested-scroll-header.js +11 -0
  101. package/dist/collection/components/open-container/open-container.js +11 -0
  102. package/dist/collection/components/progress/style/index.css +1 -1
  103. package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +3 -0
  104. package/dist/collection/components/span/span.js +11 -0
  105. package/dist/collection/components/swiper/swiper.js +59 -5
  106. package/dist/collection/components/tabbar/style/index.css +1 -1
  107. package/dist/collection/components/video/video.js +8 -3
  108. package/dist/collection/components/view/style/index.css +1 -1
  109. package/dist/collection/utils/index.js +10 -0
  110. package/dist/components/index.d.ts +7 -0
  111. package/dist/components/index.js +7 -0
  112. package/dist/components/index2.js +45 -27
  113. package/dist/components/index3.js +6 -1
  114. package/dist/components/taro-draggable-sheet-core.d.ts +11 -0
  115. package/dist/components/taro-draggable-sheet-core.js +33 -0
  116. package/dist/components/taro-grid-builder-core.d.ts +11 -0
  117. package/dist/components/taro-grid-builder-core.js +33 -0
  118. package/dist/components/taro-input-core.js +1 -1
  119. package/dist/components/taro-list-builder-core.d.ts +11 -0
  120. package/dist/components/taro-list-builder-core.js +33 -0
  121. package/dist/components/taro-map-core.js +1349 -6
  122. package/dist/components/taro-movable-area-core.js +2 -1
  123. package/dist/components/taro-movable-view-core.js +3 -1
  124. package/dist/components/taro-nested-scroll-body-core.d.ts +11 -0
  125. package/dist/components/taro-nested-scroll-body-core.js +33 -0
  126. package/dist/components/taro-nested-scroll-header-core.d.ts +11 -0
  127. package/dist/components/taro-nested-scroll-header-core.js +33 -0
  128. package/dist/components/taro-open-container-core.d.ts +11 -0
  129. package/dist/components/taro-open-container-core.js +33 -0
  130. package/dist/components/taro-progress-core.js +1 -1
  131. package/dist/components/taro-pull-to-refresh-core.js +3 -0
  132. package/dist/components/taro-span-core.d.ts +11 -0
  133. package/dist/components/taro-span-core.js +33 -0
  134. package/dist/components/taro-swiper-core.js +40 -5
  135. package/dist/components/taro-tabbar.js +2 -2
  136. package/dist/components/taro-video-core.js +8 -3
  137. package/dist/components/taro-view-core.js +1 -1
  138. package/dist/esm/{index-486e187e.js → index-9924aee9.js} +209 -5
  139. package/dist/esm/{index-d1b03e47.js → index-a00a7418.js} +6 -1
  140. package/dist/esm/{index-c3e4004b.js → index-b9522531.js} +45 -27
  141. package/dist/esm/loader.js +3 -3
  142. package/dist/esm/taro-ad-core.entry.js +1 -1
  143. package/dist/esm/taro-ad-custom-core.entry.js +1 -1
  144. package/dist/esm/taro-animation-video-core.entry.js +1 -1
  145. package/dist/esm/taro-animation-view-core.entry.js +1 -1
  146. package/dist/esm/taro-ar-camera-core.entry.js +1 -1
  147. package/dist/esm/taro-audio-core.entry.js +1 -1
  148. package/dist/esm/taro-aweme-data-core.entry.js +1 -1
  149. package/dist/esm/taro-block-core.entry.js +1 -1
  150. package/dist/esm/taro-button-core.entry.js +2 -2
  151. package/dist/esm/taro-camera-core.entry.js +1 -1
  152. package/dist/esm/taro-canvas-core.entry.js +1 -1
  153. package/dist/esm/taro-channel-live-core.entry.js +1 -1
  154. package/dist/esm/taro-channel-video-core.entry.js +1 -1
  155. package/dist/esm/taro-checkbox-core_2.entry.js +1 -1
  156. package/dist/esm/taro-comment-detail-core.entry.js +1 -1
  157. package/dist/esm/taro-comment-list-core.entry.js +1 -1
  158. package/dist/esm/taro-components.js +3 -3
  159. package/dist/esm/taro-contact-button-core.entry.js +1 -1
  160. package/dist/esm/taro-cover-image-core.entry.js +1 -1
  161. package/dist/esm/taro-cover-view-core.entry.js +2 -2
  162. package/dist/esm/taro-custom-wrapper-core.entry.js +1 -1
  163. package/dist/esm/taro-draggable-sheet-core.entry.js +17 -0
  164. package/dist/esm/taro-editor-core.entry.js +1 -1
  165. package/dist/esm/taro-follow-swan-core.entry.js +1 -1
  166. package/dist/esm/taro-form-core.entry.js +1 -1
  167. package/dist/esm/taro-functional-page-navigator-core.entry.js +1 -1
  168. package/dist/esm/taro-grid-builder-core.entry.js +17 -0
  169. package/dist/esm/taro-grid-view-core.entry.js +1 -1
  170. package/dist/esm/taro-icon-core.entry.js +2 -2
  171. package/dist/esm/taro-image-core.entry.js +2 -2
  172. package/dist/esm/taro-inline-payment-panel-core.entry.js +1 -1
  173. package/dist/esm/taro-input-core.entry.js +2 -2
  174. package/dist/esm/taro-keyboard-accessory-core.entry.js +1 -1
  175. package/dist/esm/taro-label-core.entry.js +1 -1
  176. package/dist/esm/taro-lifestyle-core.entry.js +1 -1
  177. package/dist/esm/taro-like-core.entry.js +1 -1
  178. package/dist/esm/taro-list-builder-core.entry.js +17 -0
  179. package/dist/esm/taro-list-view-core.entry.js +1 -1
  180. package/dist/esm/taro-live-player-core.entry.js +1 -1
  181. package/dist/esm/taro-live-pusher-core.entry.js +1 -1
  182. package/dist/esm/taro-login-core.entry.js +1 -1
  183. package/dist/esm/taro-lottie-core.entry.js +1 -1
  184. package/dist/esm/taro-map-core.entry.js +1321 -6
  185. package/dist/esm/taro-match-media-core.entry.js +1 -1
  186. package/dist/esm/taro-movable-area-core_2.entry.js +6 -3
  187. package/dist/esm/taro-native-slot-core.entry.js +1 -1
  188. package/dist/esm/taro-navigation-bar-core.entry.js +1 -1
  189. package/dist/esm/taro-navigator-core.entry.js +2 -2
  190. package/dist/esm/taro-nested-scroll-body-core.entry.js +17 -0
  191. package/dist/esm/taro-nested-scroll-header-core.entry.js +17 -0
  192. package/dist/esm/taro-official-account-core.entry.js +1 -1
  193. package/dist/esm/taro-open-container-core.entry.js +17 -0
  194. package/dist/esm/taro-open-data-core.entry.js +1 -1
  195. package/dist/esm/taro-page-container-core.entry.js +1 -1
  196. package/dist/esm/taro-page-meta-core.entry.js +1 -1
  197. package/dist/esm/taro-picker-core_2.entry.js +2 -2
  198. package/dist/esm/taro-picker-view-column-core_2.entry.js +3 -3
  199. package/dist/esm/taro-progress-core.entry.js +2 -2
  200. package/dist/esm/taro-pull-to-refresh-core.entry.js +5 -2
  201. package/dist/esm/taro-radio-core_2.entry.js +1 -1
  202. package/dist/esm/taro-rich-text-core.entry.js +1 -1
  203. package/dist/esm/taro-root-portal-core.entry.js +1 -1
  204. package/dist/esm/taro-rtc-room-core.entry.js +1 -1
  205. package/dist/esm/taro-rtc-room-item-core.entry.js +1 -1
  206. package/dist/esm/taro-scroll-view-core.entry.js +3 -3
  207. package/dist/esm/taro-share-element-core.entry.js +1 -1
  208. package/dist/esm/taro-slider-core.entry.js +1 -1
  209. package/dist/esm/taro-slot-core.entry.js +1 -1
  210. package/dist/esm/taro-snapshot-core.entry.js +1 -1
  211. package/dist/esm/taro-span-core.entry.js +17 -0
  212. package/dist/esm/taro-sticky-header-core.entry.js +1 -1
  213. package/dist/esm/taro-sticky-section-core.entry.js +1 -1
  214. package/dist/esm/taro-swiper-core_2.entry.js +42 -8
  215. package/dist/esm/taro-switch-core.entry.js +1 -1
  216. package/dist/esm/taro-tab-item-core.entry.js +1 -1
  217. package/dist/esm/taro-tabbar.entry.js +4 -4
  218. package/dist/esm/taro-tabs-core.entry.js +1 -1
  219. package/dist/esm/taro-text-core.entry.js +1 -1
  220. package/dist/esm/taro-textarea-core.entry.js +1 -1
  221. package/dist/esm/taro-video-control_3.entry.js +11 -6
  222. package/dist/esm/taro-view-core.entry.js +3 -3
  223. package/dist/esm/taro-voip-room-core.entry.js +1 -1
  224. package/dist/esm/taro-web-view-core.entry.js +1 -1
  225. package/dist/esm-es5/index-9924aee9.js +2 -0
  226. package/dist/esm-es5/index-a00a7418.js +1 -0
  227. package/dist/esm-es5/index-b9522531.js +7 -0
  228. package/dist/esm-es5/loader.js +1 -1
  229. package/dist/esm-es5/taro-ad-core.entry.js +1 -1
  230. package/dist/esm-es5/taro-ad-custom-core.entry.js +1 -1
  231. package/dist/esm-es5/taro-animation-video-core.entry.js +1 -1
  232. package/dist/esm-es5/taro-animation-view-core.entry.js +1 -1
  233. package/dist/esm-es5/taro-ar-camera-core.entry.js +1 -1
  234. package/dist/esm-es5/taro-audio-core.entry.js +1 -1
  235. package/dist/esm-es5/taro-aweme-data-core.entry.js +1 -1
  236. package/dist/esm-es5/taro-block-core.entry.js +1 -1
  237. package/dist/esm-es5/taro-button-core.entry.js +1 -1
  238. package/dist/esm-es5/taro-camera-core.entry.js +1 -1
  239. package/dist/esm-es5/taro-canvas-core.entry.js +1 -1
  240. package/dist/esm-es5/taro-channel-live-core.entry.js +1 -1
  241. package/dist/esm-es5/taro-channel-video-core.entry.js +1 -1
  242. package/dist/esm-es5/taro-checkbox-core_2.entry.js +1 -1
  243. package/dist/esm-es5/taro-comment-detail-core.entry.js +1 -1
  244. package/dist/esm-es5/taro-comment-list-core.entry.js +1 -1
  245. package/dist/esm-es5/taro-components.js +1 -1
  246. package/dist/esm-es5/taro-contact-button-core.entry.js +1 -1
  247. package/dist/esm-es5/taro-cover-image-core.entry.js +1 -1
  248. package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
  249. package/dist/esm-es5/taro-custom-wrapper-core.entry.js +1 -1
  250. package/dist/esm-es5/taro-draggable-sheet-core.entry.js +1 -0
  251. package/dist/esm-es5/taro-editor-core.entry.js +1 -1
  252. package/dist/esm-es5/taro-follow-swan-core.entry.js +1 -1
  253. package/dist/esm-es5/taro-form-core.entry.js +1 -1
  254. package/dist/esm-es5/taro-functional-page-navigator-core.entry.js +1 -1
  255. package/dist/esm-es5/taro-grid-builder-core.entry.js +1 -0
  256. package/dist/esm-es5/taro-grid-view-core.entry.js +1 -1
  257. package/dist/esm-es5/taro-icon-core.entry.js +1 -1
  258. package/dist/esm-es5/taro-image-core.entry.js +1 -1
  259. package/dist/esm-es5/taro-inline-payment-panel-core.entry.js +1 -1
  260. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  261. package/dist/esm-es5/taro-keyboard-accessory-core.entry.js +1 -1
  262. package/dist/esm-es5/taro-label-core.entry.js +1 -1
  263. package/dist/esm-es5/taro-lifestyle-core.entry.js +1 -1
  264. package/dist/esm-es5/taro-like-core.entry.js +1 -1
  265. package/dist/esm-es5/taro-list-builder-core.entry.js +1 -0
  266. package/dist/esm-es5/taro-list-view-core.entry.js +1 -1
  267. package/dist/esm-es5/taro-live-player-core.entry.js +1 -1
  268. package/dist/esm-es5/taro-live-pusher-core.entry.js +1 -1
  269. package/dist/esm-es5/taro-login-core.entry.js +1 -1
  270. package/dist/esm-es5/taro-lottie-core.entry.js +1 -1
  271. package/dist/esm-es5/taro-map-core.entry.js +1 -1
  272. package/dist/esm-es5/taro-match-media-core.entry.js +1 -1
  273. package/dist/esm-es5/taro-movable-area-core_2.entry.js +1 -1
  274. package/dist/esm-es5/taro-native-slot-core.entry.js +1 -1
  275. package/dist/esm-es5/taro-navigation-bar-core.entry.js +1 -1
  276. package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
  277. package/dist/esm-es5/taro-nested-scroll-body-core.entry.js +1 -0
  278. package/dist/esm-es5/taro-nested-scroll-header-core.entry.js +1 -0
  279. package/dist/esm-es5/taro-official-account-core.entry.js +1 -1
  280. package/dist/esm-es5/taro-open-container-core.entry.js +1 -0
  281. package/dist/esm-es5/taro-open-data-core.entry.js +1 -1
  282. package/dist/esm-es5/taro-page-container-core.entry.js +1 -1
  283. package/dist/esm-es5/taro-page-meta-core.entry.js +1 -1
  284. package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
  285. package/dist/esm-es5/taro-picker-view-column-core_2.entry.js +1 -1
  286. package/dist/esm-es5/taro-progress-core.entry.js +1 -1
  287. package/dist/esm-es5/taro-pull-to-refresh-core.entry.js +1 -1
  288. package/dist/esm-es5/taro-radio-core_2.entry.js +1 -1
  289. package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
  290. package/dist/esm-es5/taro-root-portal-core.entry.js +1 -1
  291. package/dist/esm-es5/taro-rtc-room-core.entry.js +1 -1
  292. package/dist/esm-es5/taro-rtc-room-item-core.entry.js +1 -1
  293. package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
  294. package/dist/esm-es5/taro-share-element-core.entry.js +1 -1
  295. package/dist/esm-es5/taro-slider-core.entry.js +1 -1
  296. package/dist/esm-es5/taro-slot-core.entry.js +1 -1
  297. package/dist/esm-es5/taro-snapshot-core.entry.js +1 -1
  298. package/dist/esm-es5/taro-span-core.entry.js +1 -0
  299. package/dist/esm-es5/taro-sticky-header-core.entry.js +1 -1
  300. package/dist/esm-es5/taro-sticky-section-core.entry.js +1 -1
  301. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  302. package/dist/esm-es5/taro-switch-core.entry.js +1 -1
  303. package/dist/esm-es5/taro-tab-item-core.entry.js +1 -1
  304. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  305. package/dist/esm-es5/taro-tabs-core.entry.js +1 -1
  306. package/dist/esm-es5/taro-text-core.entry.js +1 -1
  307. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  308. package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
  309. package/dist/esm-es5/taro-view-core.entry.js +1 -1
  310. package/dist/esm-es5/taro-voip-room-core.entry.js +1 -1
  311. package/dist/esm-es5/taro-web-view-core.entry.js +1 -1
  312. package/dist/hydrate/index.d.ts +217 -0
  313. package/dist/hydrate/index.js +14603 -0
  314. package/dist/hydrate/package.json +6 -0
  315. package/dist/taro-components/p-010faa87.system.js +1 -0
  316. package/dist/taro-components/p-02465454.system.entry.js +1 -0
  317. package/dist/taro-components/{p-600d9210.entry.js → p-02d4d104.entry.js} +1 -1
  318. package/dist/taro-components/{p-74129eac.entry.js → p-03dc0283.entry.js} +1 -1
  319. package/dist/taro-components/p-047e4bfe.entry.js +1 -0
  320. package/dist/taro-components/{p-7b6f6526.system.entry.js → p-06adeb65.system.entry.js} +1 -1
  321. package/dist/taro-components/{p-95058ee1.entry.js → p-078cb65e.entry.js} +1 -1
  322. package/dist/taro-components/{p-bcf5d78a.system.entry.js → p-07ae6678.system.entry.js} +1 -1
  323. package/dist/taro-components/p-07f27474.entry.js +1 -0
  324. package/dist/taro-components/{p-014534ca.system.entry.js → p-083c3147.system.entry.js} +1 -1
  325. package/dist/taro-components/{p-e09e8b51.system.entry.js → p-0a64f78c.system.entry.js} +1 -1
  326. package/dist/taro-components/p-0f2c1ecc.entry.js +1 -0
  327. package/dist/taro-components/{p-d03136d7.system.entry.js → p-0f480c38.system.entry.js} +1 -1
  328. package/dist/taro-components/{p-ff7dfc5c.system.entry.js → p-0fc790c0.system.entry.js} +1 -1
  329. package/dist/taro-components/{p-e7d82e00.entry.js → p-0ff5a55b.entry.js} +1 -1
  330. package/dist/taro-components/p-12582166.entry.js +1 -0
  331. package/dist/taro-components/p-156e9634.system.entry.js +1 -0
  332. package/dist/taro-components/p-160d710a.js +7 -0
  333. package/dist/taro-components/{p-1ee83d63.system.entry.js → p-17938fa0.system.entry.js} +1 -1
  334. package/dist/taro-components/{p-758e3319.system.entry.js → p-17b9f865.system.entry.js} +1 -1
  335. package/dist/taro-components/{p-4cbd26dd.entry.js → p-17e72555.entry.js} +1 -1
  336. package/dist/taro-components/{p-dca5e9ee.entry.js → p-18c039ef.entry.js} +1 -1
  337. package/dist/taro-components/{p-3ca9aa19.system.entry.js → p-1bd4da3b.system.entry.js} +1 -1
  338. package/dist/taro-components/{p-67ff5a50.system.entry.js → p-1c37143a.system.entry.js} +1 -1
  339. package/dist/taro-components/{p-d36f8c4f.entry.js → p-1eea2828.entry.js} +1 -1
  340. package/dist/taro-components/p-204996e7.entry.js +1 -0
  341. package/dist/taro-components/{p-00d05751.entry.js → p-2649c7ae.entry.js} +1 -1
  342. package/dist/taro-components/p-26eb2f3f.entry.js +1 -0
  343. package/dist/taro-components/{p-3dadbe4c.system.entry.js → p-27041d86.system.entry.js} +1 -1
  344. package/dist/taro-components/{p-2059cbc0.system.entry.js → p-27d372b4.system.entry.js} +1 -1
  345. package/dist/taro-components/{p-c0f710ae.entry.js → p-280795f2.entry.js} +1 -1
  346. package/dist/taro-components/p-292470e5.entry.js +1 -0
  347. package/dist/taro-components/{p-8d437a7f.entry.js → p-2d537212.entry.js} +1 -1
  348. package/dist/taro-components/p-2f177716.entry.js +1 -0
  349. package/dist/taro-components/{p-9623f19c.system.entry.js → p-3293c5d9.system.entry.js} +1 -1
  350. package/dist/taro-components/{p-5bb60b5e.entry.js → p-32c0f326.entry.js} +1 -1
  351. package/dist/taro-components/{p-9e138188.entry.js → p-35dec732.entry.js} +1 -1
  352. package/dist/taro-components/{p-9b4e5578.entry.js → p-38b29261.entry.js} +1 -1
  353. package/dist/taro-components/{p-48e5ddaa.entry.js → p-3a180dc7.entry.js} +1 -1
  354. package/dist/taro-components/{p-ebf38559.system.entry.js → p-3b36196b.system.entry.js} +1 -1
  355. package/dist/taro-components/{p-445810cb.entry.js → p-3bfe9260.entry.js} +1 -1
  356. package/dist/taro-components/{p-e26c787b.entry.js → p-3cf08137.entry.js} +1 -1
  357. package/dist/taro-components/{p-4e4cc6ab.entry.js → p-402c7f93.entry.js} +1 -1
  358. package/dist/taro-components/p-425d1d69.entry.js +1 -0
  359. package/dist/taro-components/{p-a17b1a7e.entry.js → p-43367dd1.entry.js} +1 -1
  360. package/dist/taro-components/p-443b9a72.system.js +7 -0
  361. package/dist/taro-components/p-443e31ab.system.entry.js +1 -0
  362. package/dist/taro-components/{p-dc98486d.entry.js → p-4523b1c7.entry.js} +1 -1
  363. package/dist/taro-components/{p-16954dd6.entry.js → p-46a66c43.entry.js} +1 -1
  364. package/dist/taro-components/{p-015b3025.system.entry.js → p-47790dc0.system.entry.js} +1 -1
  365. package/dist/taro-components/{p-6229bb7d.system.entry.js → p-4979e93c.system.entry.js} +1 -1
  366. package/dist/taro-components/{p-caba17c6.system.entry.js → p-4a8b4d58.system.entry.js} +1 -1
  367. package/dist/taro-components/{p-1b42ba7e.system.entry.js → p-4ac48df1.system.entry.js} +1 -1
  368. package/dist/taro-components/{p-74b1be20.system.entry.js → p-4fad4beb.system.entry.js} +1 -1
  369. package/dist/taro-components/{p-35e96af8.system.entry.js → p-50849470.system.entry.js} +1 -1
  370. package/dist/taro-components/p-53e62840.system.entry.js +1 -0
  371. package/dist/taro-components/{p-2f403f7f.entry.js → p-55e12654.entry.js} +1 -1
  372. package/dist/taro-components/p-56552c9e.entry.js +1 -0
  373. package/dist/taro-components/{p-3bd04d38.entry.js → p-56a82bf3.entry.js} +1 -1
  374. package/dist/taro-components/{p-e457a83a.system.entry.js → p-57911e2c.system.entry.js} +1 -1
  375. package/dist/taro-components/{p-10d3c795.system.entry.js → p-57b77f17.system.entry.js} +1 -1
  376. package/dist/taro-components/{p-25bbf4aa.system.entry.js → p-5884c108.system.entry.js} +1 -1
  377. package/dist/taro-components/p-5893c3ed.js +1 -0
  378. package/dist/taro-components/{p-dbb47d14.system.entry.js → p-5b9aa4b0.system.entry.js} +1 -1
  379. package/dist/taro-components/{p-f554428f.system.entry.js → p-5c156db3.system.entry.js} +1 -1
  380. package/dist/taro-components/{p-846aa5ec.entry.js → p-5c98f478.entry.js} +1 -1
  381. package/dist/taro-components/p-5f23dc41.system.entry.js +1 -0
  382. package/dist/taro-components/{p-7f084a29.system.entry.js → p-61a325d2.system.entry.js} +1 -1
  383. package/dist/taro-components/{p-9a5bfa2a.system.entry.js → p-6282bdee.system.entry.js} +1 -1
  384. package/dist/taro-components/{p-9937cf08.system.entry.js → p-65d11e99.system.entry.js} +1 -1
  385. package/dist/taro-components/{p-80106cc2.system.entry.js → p-6654374e.system.entry.js} +1 -1
  386. package/dist/taro-components/{p-8e45a207.system.entry.js → p-6664a2ca.system.entry.js} +1 -1
  387. package/dist/taro-components/p-68197378.entry.js +1 -0
  388. package/dist/taro-components/p-6989c232.entry.js +1 -0
  389. package/dist/taro-components/{p-578f19ea.system.entry.js → p-6b83388c.system.entry.js} +1 -1
  390. package/dist/taro-components/p-6ba08ce0.system.entry.js +1 -0
  391. package/dist/taro-components/{p-61cb688a.entry.js → p-6cc0bcb9.entry.js} +1 -1
  392. package/dist/taro-components/p-7163d09e.system.js +1 -0
  393. package/dist/taro-components/{p-b8858af9.system.entry.js → p-75b4c1fc.system.entry.js} +1 -1
  394. package/dist/taro-components/p-75d01c60.system.js +2 -0
  395. package/dist/taro-components/{p-de3e1cee.system.entry.js → p-75ded8a0.system.entry.js} +1 -1
  396. package/dist/taro-components/p-77e82dfa.entry.js +1 -0
  397. package/dist/taro-components/{p-870e0d9d.entry.js → p-79cad66b.entry.js} +1 -1
  398. package/dist/taro-components/p-7ca2d075.system.entry.js +1 -0
  399. package/dist/taro-components/{p-34933f34.system.entry.js → p-7e054ae7.system.entry.js} +1 -1
  400. package/dist/taro-components/p-7e692c70.entry.js +1 -0
  401. package/dist/taro-components/p-7ebd4310.entry.js +1 -0
  402. package/dist/taro-components/p-7fdbcf4d.entry.js +1 -0
  403. package/dist/taro-components/{p-88c5f0eb.system.entry.js → p-8179438b.system.entry.js} +1 -1
  404. package/dist/taro-components/{p-2d6d4850.entry.js → p-84998109.entry.js} +1 -1
  405. package/dist/taro-components/{p-5a1bb2d3.system.entry.js → p-855619b6.system.entry.js} +1 -1
  406. package/dist/taro-components/{p-1d25f4e3.entry.js → p-8b0c9d3f.entry.js} +1 -1
  407. package/dist/taro-components/{p-ba50342b.system.entry.js → p-91ee1f8a.system.entry.js} +1 -1
  408. package/dist/taro-components/p-937a6c36.entry.js +1 -0
  409. package/dist/taro-components/{p-8df92f90.system.entry.js → p-938f9036.system.entry.js} +1 -1
  410. package/dist/taro-components/{p-87422c88.entry.js → p-93a2b2e9.entry.js} +1 -1
  411. package/dist/taro-components/p-93b02321.entry.js +1 -0
  412. package/dist/taro-components/p-9571836f.entry.js +1 -0
  413. package/dist/taro-components/{p-1e3d7899.system.entry.js → p-97b09fb4.system.entry.js} +1 -1
  414. package/dist/taro-components/p-9b6b17c4.system.entry.js +1 -0
  415. package/dist/taro-components/{p-26545e4e.system.entry.js → p-9e359fff.system.entry.js} +1 -1
  416. package/dist/taro-components/{p-bdee068b.system.entry.js → p-9f53e26c.system.entry.js} +1 -1
  417. package/dist/taro-components/{p-d78ab2de.system.entry.js → p-a25aca16.system.entry.js} +1 -1
  418. package/dist/taro-components/p-a50c6736.entry.js +1 -0
  419. package/dist/taro-components/{p-205a0692.system.entry.js → p-a96f8f60.system.entry.js} +1 -1
  420. package/dist/taro-components/{p-75b927b4.system.entry.js → p-a9ca8247.system.entry.js} +1 -1
  421. package/dist/taro-components/p-aabac550.entry.js +1 -0
  422. package/dist/taro-components/p-ab0e0366.system.entry.js +1 -0
  423. package/dist/taro-components/p-ac2be5f3.entry.js +1 -0
  424. package/dist/taro-components/{p-170ce205.system.entry.js → p-ac714300.system.entry.js} +1 -1
  425. package/dist/taro-components/{p-54941baf.system.entry.js → p-ac9fb309.system.entry.js} +1 -1
  426. package/dist/taro-components/p-acb113bd.entry.js +1 -0
  427. package/dist/taro-components/p-b087ad2a.system.entry.js +1 -0
  428. package/dist/taro-components/{p-d60b66c2.entry.js → p-b1f80b6b.entry.js} +1 -1
  429. package/dist/taro-components/{p-92daad3f.system.entry.js → p-b4577a12.system.entry.js} +1 -1
  430. package/dist/taro-components/{p-55be4215.entry.js → p-b4c7bb48.entry.js} +1 -1
  431. package/dist/taro-components/p-ba11ef7d.entry.js +1 -0
  432. package/dist/taro-components/{p-3d76b46e.system.entry.js → p-ba5e7ec4.system.entry.js} +1 -1
  433. package/dist/taro-components/{p-861834ce.entry.js → p-bb67318d.entry.js} +1 -1
  434. package/dist/taro-components/{p-970623a1.entry.js → p-bd57edcd.entry.js} +1 -1
  435. package/dist/taro-components/{p-8b70fd1d.entry.js → p-be055537.entry.js} +1 -1
  436. package/dist/taro-components/{p-6e9d509a.entry.js → p-be1701b2.entry.js} +1 -1
  437. package/dist/taro-components/{p-6cf765b7.system.entry.js → p-c056d527.system.entry.js} +1 -1
  438. package/dist/taro-components/{p-b04cdd9a.system.entry.js → p-c0c567e5.system.entry.js} +1 -1
  439. package/dist/taro-components/{p-9890bb7b.entry.js → p-c3dc7072.entry.js} +1 -1
  440. package/dist/taro-components/{p-0cf04b3d.system.entry.js → p-c677414d.system.entry.js} +1 -1
  441. package/dist/taro-components/p-c71d5745.system.entry.js +1 -0
  442. package/dist/taro-components/{p-510a69b3.entry.js → p-c7836e2b.entry.js} +1 -1
  443. package/dist/taro-components/p-c7d8c076.system.entry.js +1 -0
  444. package/dist/taro-components/{p-37593ce7.entry.js → p-c8cd6e16.entry.js} +1 -1
  445. package/dist/taro-components/p-c95d2b90.entry.js +1 -0
  446. package/dist/taro-components/{p-a197cbae.system.entry.js → p-ca6a5916.system.entry.js} +1 -1
  447. package/dist/taro-components/{p-07e94301.system.entry.js → p-cae6c5d0.system.entry.js} +1 -1
  448. package/dist/taro-components/{p-50e1ba06.system.entry.js → p-cafbb3d9.system.entry.js} +1 -1
  449. package/dist/taro-components/{p-2f683899.entry.js → p-ccbaba23.entry.js} +1 -1
  450. package/dist/taro-components/{p-940d41e9.system.entry.js → p-d05eb105.system.entry.js} +1 -1
  451. package/dist/taro-components/{p-352b6b6b.system.entry.js → p-d2203687.system.entry.js} +1 -1
  452. package/dist/taro-components/{p-bb712e32.entry.js → p-d5603857.entry.js} +1 -1
  453. package/dist/taro-components/{p-290fd78b.system.entry.js → p-d73b3a94.system.entry.js} +1 -1
  454. package/dist/taro-components/p-d87a68f6.entry.js +1 -0
  455. package/dist/taro-components/{p-bdd7b5a9.entry.js → p-d973d536.entry.js} +1 -1
  456. package/dist/taro-components/{p-e25c2a22.entry.js → p-d9884371.entry.js} +1 -1
  457. package/dist/taro-components/p-dc08715a.entry.js +1 -0
  458. package/dist/taro-components/{p-4928ee37.entry.js → p-dc25fa81.entry.js} +1 -1
  459. package/dist/taro-components/p-dcf5747c.system.entry.js +1 -0
  460. package/dist/taro-components/{p-581e844d.system.entry.js → p-ddf75d6a.system.entry.js} +1 -1
  461. package/dist/taro-components/{p-02dd30fa.system.entry.js → p-ded98693.system.entry.js} +1 -1
  462. package/dist/taro-components/{p-2dea35fd.entry.js → p-dedf50a9.entry.js} +1 -1
  463. package/dist/taro-components/{p-040f15f2.system.entry.js → p-df7c6216.system.entry.js} +1 -1
  464. package/dist/taro-components/{p-64f5abce.entry.js → p-e1cce2f1.entry.js} +1 -1
  465. package/dist/taro-components/p-e2e7bc16.entry.js +1 -0
  466. package/dist/taro-components/p-e3d825d1.system.entry.js +1 -0
  467. package/dist/taro-components/p-e5ef41f2.system.entry.js +1 -0
  468. package/dist/taro-components/p-e62a1287.js +2 -0
  469. package/dist/taro-components/p-e681d764.entry.js +1 -0
  470. package/dist/taro-components/{p-a2a70581.system.entry.js → p-e853a2c8.system.entry.js} +1 -1
  471. package/dist/taro-components/{p-2bbdbe9c.system.entry.js → p-ebad862a.system.entry.js} +1 -1
  472. package/dist/taro-components/{p-b8e2465a.entry.js → p-ebb1ae64.entry.js} +1 -1
  473. package/dist/taro-components/{p-80278124.entry.js → p-f034a433.entry.js} +1 -1
  474. package/dist/taro-components/{p-ba195b39.entry.js → p-f168fffc.entry.js} +1 -1
  475. package/dist/taro-components/p-f367a754.entry.js +1 -0
  476. package/dist/taro-components/{p-128f9eb0.entry.js → p-f43f26cf.entry.js} +1 -1
  477. package/dist/taro-components/{p-bba220a9.entry.js → p-f5f3a111.entry.js} +1 -1
  478. package/dist/taro-components/{p-3e9bf572.entry.js → p-f8f2461f.entry.js} +1 -1
  479. package/dist/taro-components/{p-c11fcb25.system.entry.js → p-f9935901.system.entry.js} +1 -1
  480. package/dist/taro-components/{p-7cecf08e.system.entry.js → p-fa31b2de.system.entry.js} +1 -1
  481. package/dist/taro-components/{p-1ced140d.entry.js → p-fab63183.entry.js} +1 -1
  482. package/dist/taro-components/{p-114f89d6.system.entry.js → p-fbf13159.system.entry.js} +1 -1
  483. package/dist/taro-components/{p-dc6db06e.system.entry.js → p-fe5eefdc.system.entry.js} +1 -1
  484. package/dist/taro-components/{p-28bf8423.system.entry.js → p-feb89474.system.entry.js} +1 -1
  485. package/dist/taro-components/p-ff772345.entry.js +1 -0
  486. package/dist/taro-components/taro-components.css +1 -1
  487. package/dist/taro-components/taro-components.esm.js +1 -1
  488. package/dist/taro-components/taro-components.js +1 -1
  489. package/dist/types/components/draggable-sheet/draggable-sheet.d.ts +5 -0
  490. package/dist/types/components/grid-builder/grid-builder.d.ts +5 -0
  491. package/dist/types/components/list-builder/list-builder.d.ts +5 -0
  492. package/dist/types/components/map/map.d.ts +145 -2
  493. package/dist/types/components/nested-scroll-body/nested-scroll-body.d.ts +5 -0
  494. package/dist/types/components/nested-scroll-header/nested-scroll-header.d.ts +5 -0
  495. package/dist/types/components/open-container/open-container.d.ts +5 -0
  496. package/dist/types/components/span/span.d.ts +5 -0
  497. package/dist/types/components/swiper/swiper.d.ts +5 -0
  498. package/dist/types/components.d.ts +313 -1
  499. package/dist/types/utils/index.d.ts +2 -0
  500. package/global.css +1 -0
  501. package/lib/react/component-lib/index.d.ts +53 -53
  502. package/lib/react/component-lib/input.d.ts +1 -1
  503. package/lib/react/component-lib/input.js.map +1 -1
  504. package/lib/react/component-lib/reactify-wc.d.ts +1 -1
  505. package/lib/react/component-lib/reactify-wc.js.map +1 -1
  506. package/lib/react/components.d.ts +92 -85
  507. package/lib/react/components.js +11 -2
  508. package/lib/react/components.js.map +1 -1
  509. package/lib/react/helper.d.ts +4 -2
  510. package/lib/react/helper.js.map +1 -1
  511. package/lib/react/index.d.ts +1 -1
  512. package/lib/react/index.js +1 -1
  513. package/lib/react/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.18.0_tslib@2.6.2_typescript@5.4.5/node_modules/tslib/tslib.es6.js +373 -0
  514. package/lib/react/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.18.0_tslib@2.6.2_typescript@5.4.5/node_modules/tslib/tslib.es6.js.map +1 -0
  515. package/lib/react/react-component-lib/createComponent.d.ts +3 -3
  516. package/lib/react/react-component-lib/createComponent.js +1 -1
  517. package/lib/react/react-component-lib/createComponent.js.map +1 -1
  518. package/lib/react/react-component-lib/createOverlayComponent.d.ts +5 -5
  519. package/lib/react/react-component-lib/createOverlayComponent.js +1 -1
  520. package/lib/react/react-component-lib/createOverlayComponent.js.map +1 -1
  521. package/lib/react/react-component-lib/index.d.ts +2 -2
  522. package/lib/react/{interfaces-f526f1a2.d.ts → react-component-lib/interfaces.d.ts} +4 -5
  523. package/lib/react/react-component-lib/utils/attachProps.d.ts +6 -6
  524. package/lib/react/react-component-lib/utils/attachProps.js +2 -2
  525. package/lib/react/react-component-lib/utils/attachProps.js.map +1 -1
  526. package/lib/react/react-component-lib/utils/case.d.ts +2 -3
  527. package/lib/react/react-component-lib/utils/dev.d.ts +6 -0
  528. package/lib/react/react-component-lib/utils/index.d.ts +9 -10
  529. package/lib/react/react-component-lib/utils/index.js.map +1 -1
  530. package/lib/solid/component-lib/index.d.ts +53 -0
  531. package/lib/solid/component-lib/index.js +69 -0
  532. package/lib/solid/component-lib/index.js.map +1 -0
  533. package/lib/solid/components.d.ts +92 -0
  534. package/lib/solid/components.js +102 -0
  535. package/lib/solid/components.js.map +1 -0
  536. package/lib/solid/helper.d.ts +3 -0
  537. package/lib/solid/helper.js +7 -0
  538. package/lib/solid/helper.js.map +1 -0
  539. package/lib/solid/index.d.ts +1 -0
  540. package/lib/solid/index.js +2 -0
  541. package/lib/solid/solid-component-lib/createComponent.d.ts +10 -0
  542. package/lib/solid/solid-component-lib/createComponent.js +67 -0
  543. package/lib/solid/solid-component-lib/createComponent.js.map +1 -0
  544. package/lib/solid/solid-component-lib/index.d.ts +1 -0
  545. package/lib/solid/solid-component-lib/index.js +2 -0
  546. package/lib/solid/solid-component-lib/index.js.map +1 -0
  547. package/lib/solid/solid-component-lib/interfaces.d.ts +33 -0
  548. package/lib/solid/solid-component-lib/utils/case.d.ts +3 -0
  549. package/lib/solid/solid-component-lib/utils/case.js +6 -0
  550. package/lib/solid/solid-component-lib/utils/case.js.map +1 -0
  551. package/lib/solid/solid-component-lib/utils/element.d.ts +6 -0
  552. package/lib/solid/solid-component-lib/utils/element.js +48 -0
  553. package/lib/solid/solid-component-lib/utils/element.js.map +1 -0
  554. package/lib/solid/solid-component-lib/utils/index.d.ts +2 -0
  555. package/lib/solid/solid-component-lib/utils/index.js +3 -0
  556. package/lib/solid/solid-component-lib/utils/index.js.map +1 -0
  557. package/lib/vue3/component-lib/createComponent.d.ts +1 -2
  558. package/lib/vue3/component-lib/createFormsComponent.d.ts +1 -2
  559. package/lib/vue3/component-lib/createFormsComponent.js.map +1 -1
  560. package/lib/vue3/component-lib/forwardRef.d.ts +1 -2
  561. package/lib/vue3/component-lib/icon.d.ts +1 -1
  562. package/lib/vue3/component-lib/image.d.ts +1 -1
  563. package/lib/vue3/component-lib/index.d.ts +52 -53
  564. package/lib/vue3/component-lib/scroll-view.d.ts +1 -1
  565. package/lib/vue3/component-lib/scroll-view.js.map +1 -1
  566. package/lib/vue3/component-lib/text.d.ts +1 -1
  567. package/lib/vue3/components-loader.d.ts +1 -2
  568. package/lib/vue3/components-loader.js.map +1 -1
  569. package/lib/vue3/components.d.ts +91 -85
  570. package/lib/vue3/components.js +41 -3
  571. package/lib/vue3/components.js.map +1 -1
  572. package/lib/vue3/index.d.ts +1 -1
  573. package/lib/vue3/index.js +1 -1
  574. package/lib/vue3/vue-component-lib/utils.d.ts +2 -3
  575. package/lib/vue3/vue-component-lib/utils.js.map +1 -1
  576. package/package.json +30 -21
  577. package/types/Canvas.d.ts +1 -1
  578. package/types/DraggableSheet.d.ts +47 -0
  579. package/types/GridBuilder.d.ts +72 -0
  580. package/types/GridView.d.ts +18 -4
  581. package/types/Input.d.ts +2 -1
  582. package/types/ListBuilder.d.ts +55 -0
  583. package/types/ListView.d.ts +9 -2
  584. package/types/Map.d.ts +0 -2
  585. package/types/NavigationBar.d.ts +5 -5
  586. package/types/NestedScrollBody.d.ts +15 -0
  587. package/types/NestedScrollHeader.d.ts +15 -0
  588. package/types/OpenContainer.d.ts +74 -0
  589. package/types/PageMeta.d.ts +13 -7
  590. package/types/Picker.d.ts +6 -1
  591. package/types/PickerView.d.ts +1 -0
  592. package/types/Script.d.ts +37 -0
  593. package/types/ScrollView.d.ts +8 -2
  594. package/types/ShareElement.d.ts +1 -0
  595. package/types/Slider.d.ts +3 -2
  596. package/types/Snapshot.d.ts +12 -3
  597. package/types/Span.d.ts +14 -0
  598. package/types/StickyHeader.d.ts +15 -2
  599. package/types/StickySection.d.ts +7 -1
  600. package/types/Swiper.d.ts +1 -3
  601. package/types/Switch.d.ts +2 -1
  602. package/types/Text.d.ts +16 -0
  603. package/types/Textarea.d.ts +2 -1
  604. package/types/common.d.ts +2 -2
  605. package/types/index.d.ts +8 -0
  606. package/types/index.vue3.d.ts +4 -0
  607. package/dist/esm-es5/index-486e187e.js +0 -2
  608. package/dist/esm-es5/index-c3e4004b.js +0 -7
  609. package/dist/esm-es5/index-d1b03e47.js +0 -1
  610. package/dist/taro-components/p-06cf6b18.system.entry.js +0 -1
  611. package/dist/taro-components/p-0e3d8ada.entry.js +0 -1
  612. package/dist/taro-components/p-101f49dd.entry.js +0 -1
  613. package/dist/taro-components/p-1182efdd.system.entry.js +0 -1
  614. package/dist/taro-components/p-2ec68968.system.js +0 -7
  615. package/dist/taro-components/p-30623371.entry.js +0 -1
  616. package/dist/taro-components/p-387f300a.entry.js +0 -1
  617. package/dist/taro-components/p-3afbae36.entry.js +0 -1
  618. package/dist/taro-components/p-4408d796.entry.js +0 -1
  619. package/dist/taro-components/p-449f60fa.entry.js +0 -1
  620. package/dist/taro-components/p-46661961.entry.js +0 -1
  621. package/dist/taro-components/p-4e4ac1fe.system.entry.js +0 -1
  622. package/dist/taro-components/p-5307637c.system.entry.js +0 -1
  623. package/dist/taro-components/p-6066e633.entry.js +0 -1
  624. package/dist/taro-components/p-69e747dc.entry.js +0 -1
  625. package/dist/taro-components/p-6bbb639a.system.js +0 -2
  626. package/dist/taro-components/p-6f027b85.entry.js +0 -1
  627. package/dist/taro-components/p-72b954ce.system.entry.js +0 -1
  628. package/dist/taro-components/p-764cd497.entry.js +0 -1
  629. package/dist/taro-components/p-7bd1345f.entry.js +0 -1
  630. package/dist/taro-components/p-83699a53.entry.js +0 -1
  631. package/dist/taro-components/p-95e88e0f.entry.js +0 -1
  632. package/dist/taro-components/p-98b1fc13.js +0 -2
  633. package/dist/taro-components/p-a61e195b.entry.js +0 -1
  634. package/dist/taro-components/p-a972aa1d.system.js +0 -1
  635. package/dist/taro-components/p-ae128150.entry.js +0 -1
  636. package/dist/taro-components/p-b317674b.entry.js +0 -1
  637. package/dist/taro-components/p-b6694eb3.system.entry.js +0 -1
  638. package/dist/taro-components/p-b9f19e77.entry.js +0 -1
  639. package/dist/taro-components/p-bb87373d.entry.js +0 -1
  640. package/dist/taro-components/p-bd5177d3.system.js +0 -1
  641. package/dist/taro-components/p-bf0d2c21.system.entry.js +0 -1
  642. package/dist/taro-components/p-cbc19d63.entry.js +0 -1
  643. package/dist/taro-components/p-d3c7f87d.js +0 -1
  644. package/dist/taro-components/p-de951a46.js +0 -7
  645. package/dist/taro-components/p-e1c2e636.entry.js +0 -1
  646. package/dist/taro-components/p-eeb6aeb5.system.entry.js +0 -1
  647. package/dist/taro-components/p-ef0aff29.entry.js +0 -1
  648. package/dist/taro-components/p-fd1d75db.entry.js +0 -1
  649. package/lib/vue2/component-lib/components.d.ts +0 -111
  650. package/lib/vue2/component-lib/components.js +0 -74
  651. package/lib/vue2/component-lib/components.js.map +0 -1
  652. package/lib/vue2/component-lib/createComponent.d.ts +0 -14
  653. package/lib/vue2/component-lib/createComponent.js +0 -23
  654. package/lib/vue2/component-lib/createComponent.js.map +0 -1
  655. package/lib/vue2/component-lib/createFormsComponent.d.ts +0 -22
  656. package/lib/vue2/component-lib/createFormsComponent.js +0 -53
  657. package/lib/vue2/component-lib/createFormsComponent.js.map +0 -1
  658. package/lib/vue2/component-lib/icon.d.ts +0 -16
  659. package/lib/vue2/component-lib/icon.js +0 -23
  660. package/lib/vue2/component-lib/icon.js.map +0 -1
  661. package/lib/vue2/component-lib/image.d.ts +0 -16
  662. package/lib/vue2/component-lib/image.js +0 -24
  663. package/lib/vue2/component-lib/image.js.map +0 -1
  664. package/lib/vue2/component-lib/index.d.ts +0 -1
  665. package/lib/vue2/component-lib/index.js +0 -25
  666. package/lib/vue2/component-lib/index.js.map +0 -1
  667. package/lib/vue2/component-lib/mixins/listeners.d.ts +0 -6
  668. package/lib/vue2/component-lib/mixins/listeners.js +0 -14
  669. package/lib/vue2/component-lib/mixins/listeners.js.map +0 -1
  670. package/lib/vue2/component-lib/mixins/refs.d.ts +0 -5
  671. package/lib/vue2/component-lib/mixins/refs.js +0 -53
  672. package/lib/vue2/component-lib/mixins/refs.js.map +0 -1
  673. package/lib/vue2/component-lib/picker.d.ts +0 -25
  674. package/lib/vue2/component-lib/picker.js +0 -41
  675. package/lib/vue2/component-lib/picker.js.map +0 -1
  676. package/lib/vue2/component-lib/scroll-view.d.ts +0 -17
  677. package/lib/vue2/component-lib/scroll-view.js +0 -35
  678. package/lib/vue2/component-lib/scroll-view.js.map +0 -1
  679. package/lib/vue2/component-lib/text.d.ts +0 -16
  680. package/lib/vue2/component-lib/text.js +0 -24
  681. package/lib/vue2/component-lib/text.js.map +0 -1
  682. package/lib/vue2/components-loader.d.ts +0 -2
  683. package/lib/vue2/components-loader.js +0 -21
  684. package/lib/vue2/components-loader.js.map +0 -1
  685. package/lib/vue2/components.d.ts +0 -373
  686. package/lib/vue2/components.js +0 -583
  687. package/lib/vue2/components.js.map +0 -1
  688. package/lib/vue2/index.d.ts +0 -1
  689. package/lib/vue2/index.js +0 -2
  690. package/lib/vue2/node_modules/.pnpm/registry.npmjs.org_vue-fragment@1.6.0_vue@2.7.14/node_modules/vue-fragment/dist/vue-fragment.esm.js +0 -4
  691. package/lib/vue2/node_modules/.pnpm/registry.npmjs.org_vue-fragment@1.6.0_vue@2.7.14/node_modules/vue-fragment/dist/vue-fragment.esm.js.map +0 -1
  692. package/lib/vue2/vue-component-lib/utils.d.ts +0 -10
  693. package/lib/vue2/vue-component-lib/utils.js +0 -51
  694. package/lib/vue2/vue-component-lib/utils.js.map +0 -1
  695. /package/lib/{vue2 → solid}/index.js.map +0 -0
@@ -1,18 +1,1361 @@
1
- import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { n as notSupport } from './helper.js';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import Hammer from 'hammerjs';
3
+
4
+ const mapCss = ".BMap_cpyCtrl,.anchorBL img,.BMap_bubble_buttons{display:none}";
3
5
 
4
6
  const Map = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
7
  constructor() {
6
8
  super();
7
9
  this.__registerHost();
10
+ this.onTap = createEvent(this, "tap", 7);
11
+ this.currentRotation = 0;
12
+ /* 获取当前地图中心的经纬度 */
13
+ this._getCenterLocation = (option) => {
14
+ // 遍历当前的覆盖物,找到之前添加的中心点图标并删除它
15
+ this.map.getOverlays().forEach((overlay) => {
16
+ if (overlay instanceof BMapGL.Marker && overlay.isCenterMarker) {
17
+ this.map.removeOverlay(overlay);
18
+ }
19
+ });
20
+ // 创建自定义图标并设置图标位置
21
+ option.iconPath = 'https://img0.baidu.com/it/u=2604176863,3349829508&fm=253&fmt=auto&app=138&f=PNG?w=243&h=243';
22
+ const icon = new BMapGL.Icon(option.iconPath, new BMapGL.Size(20, 30));
23
+ // 将经纬度从BD09转换为GCJ02
24
+ const gcj02Point = [this.longitude, this.latitude];
25
+ const marker = new BMapGL.Marker(new BMapGL.Point(this.longitude, this.latitude), { icon });
26
+ marker.isCenterMarker = true; // 标记该覆盖物是中心点图标
27
+ // 添加新的图标
28
+ this.map.addOverlay(marker);
29
+ return gcj02Point;
30
+ };
31
+ /* 设置定位点图标,支持网络路径、本地路径、代码包路径 */
32
+ this._setLocMarkerIcon = (option) => {
33
+ // 创建自定义图标
34
+ const icon = new BMapGL.Icon(option.iconPath, new BMapGL.Size(20, 30));
35
+ // 创建定位点并设置图标
36
+ const point = new BMapGL.Point(116.404, 39.915);
37
+ const marker = new BMapGL.Marker(point, { icon });
38
+ this.map.addOverlay(marker);
39
+ };
40
+ /* 平移marker,带动画 */
41
+ this._translateMarker = (option) => {
42
+ let latitude = option.destination.latitude;
43
+ const longitude = option.destination.longitude;
44
+ if (latitude < -80 && latitude >= -90) {
45
+ latitude = option.destination.latitude + 10;
46
+ }
47
+ const destinationPoint = new BMapGL.Point(longitude, latitude);
48
+ const obj = {
49
+ flagId: true,
50
+ flagCoordinate: true // 标记是否有有效经纬度
51
+ };
52
+ const animationEndResult = {
53
+ errMsg: 'animationEnd:ok',
54
+ };
55
+ // 获取所有覆盖物
56
+ const overlays = this.map.getOverlays();
57
+ // 查找指定 id 的 Marker 对象
58
+ const targetMarker = overlays.find((overlay) => overlay instanceof BMapGL.Marker && overlay.id === option.markerId);
59
+ if (!targetMarker) {
60
+ console.error(`Marker "${option.markerId}" not found.`);
61
+ obj.flagId = false;
62
+ return obj;
63
+ }
64
+ if (latitude > 90 || latitude < -90 || longitude > 180 || longitude < -180 || isNaN(latitude) || isNaN(longitude)) {
65
+ obj.flagCoordinate = false;
66
+ return obj;
67
+ }
68
+ // 计算平移步长
69
+ const startLngLat = targetMarker.getPosition();
70
+ const step = {
71
+ lng: (destinationPoint.lng - startLngLat.lng) / (option.duration / 16),
72
+ lat: (destinationPoint.lat - startLngLat.lat) / (option.duration / 16), // 每帧移动的纬度增量
73
+ };
74
+ // 计算旋转角度的步长
75
+ const startRotation = targetMarker.getRotation(); // 获取起始旋转角度
76
+ const targetRotation = option.rotate; // 设置目标旋转角度
77
+ if (!this.currentRotation) {
78
+ this.currentRotation = targetRotation;
79
+ }
80
+ else {
81
+ this.currentRotation += targetRotation;
82
+ }
83
+ const rotationStep = (this.currentRotation - startRotation) / (option.duration / 16);
84
+ // 执行平移动画
85
+ let currentLngLat = startLngLat;
86
+ let currentRotation = startRotation;
87
+ if (!option.moveWithRotate && option.autoRotate) {
88
+ let currentFrame = 0; // 用于平移动画的计数器
89
+ // 执行平移动画
90
+ const animationInterval = setInterval(() => {
91
+ currentLngLat = new BMapGL.Point(currentLngLat.lng + step.lng, currentLngLat.lat + step.lat);
92
+ targetMarker.setPosition(currentLngLat);
93
+ currentFrame++;
94
+ if (currentFrame >= option.duration / 16) {
95
+ clearInterval(animationInterval);
96
+ let rotationFrame = 0; // 用于旋转动画的计数器
97
+ // 在到达目的地后执行旋转动画
98
+ const rotationInterval = setInterval(() => {
99
+ currentRotation += rotationStep;
100
+ targetMarker.setRotation(currentRotation);
101
+ rotationFrame++;
102
+ if (rotationFrame >= option.duration / 16) {
103
+ clearInterval(rotationInterval); // 清除旋转动画的定时器
104
+ option === null || option === void 0 ? void 0 : option.animationEnd(animationEndResult);
105
+ }
106
+ }, 16);
107
+ }
108
+ }, 16);
109
+ }
110
+ else if (option.moveWithRotate && option.autoRotate) {
111
+ let currentFrame = 0; // 定义局部变量
112
+ const animationInterval = setInterval(() => {
113
+ currentLngLat = new BMapGL.Point(currentLngLat.lng + step.lng, currentLngLat.lat + step.lat);
114
+ targetMarker.setPosition(currentLngLat);
115
+ currentRotation += rotationStep;
116
+ targetMarker.setRotation(currentRotation);
117
+ currentFrame++;
118
+ if (currentFrame >= option.duration / 16) {
119
+ clearInterval(animationInterval);
120
+ option === null || option === void 0 ? void 0 : option.animationEnd(animationEndResult);
121
+ }
122
+ }, 16);
123
+ }
124
+ else if (option.moveWithRotate && !option.autoRotate) {
125
+ let currentFrame = 0; // 定义局部变量
126
+ const animationInterval = setInterval(() => {
127
+ currentLngLat = new BMapGL.Point(currentLngLat.lng + step.lng, currentLngLat.lat + step.lat);
128
+ targetMarker.setPosition(currentLngLat);
129
+ currentFrame++;
130
+ if (currentFrame >= option.duration / 16) {
131
+ clearInterval(animationInterval);
132
+ option === null || option === void 0 ? void 0 : option.animationEnd(animationEndResult);
133
+ }
134
+ }, 16);
135
+ }
136
+ return obj;
137
+ };
138
+ /* 缩放视野展示所有经纬度 */
139
+ this._includePoints = (option) => {
140
+ const bPoints = option.points.map((point) => new BMapGL.Point(point.longitude, point.latitude));
141
+ const originalZoom = this.map.getZoom();
142
+ const originalCenter = this.map.getCenter();
143
+ const view = this.map.getViewport(bPoints);
144
+ // 地图缩放后
145
+ this.map.centerAndZoom(view.center, view.zoom);
146
+ const bounds = this.map.getBounds();
147
+ let flag = true;
148
+ for (let i = 0; i < bPoints.length; i++) {
149
+ if (!bounds.containsPoint(bPoints[i])) {
150
+ this.map.centerAndZoom(originalCenter, originalZoom);
151
+ flag = false;
152
+ break;
153
+ }
154
+ }
155
+ return flag;
156
+ };
157
+ /* 获取当前地图的视野范围 */
158
+ this._getRegion = () => {
159
+ // 获取地图当前视野范围
160
+ const bounds = this.map.getBounds();
161
+ const sw = bounds.getSouthWest(); // 西南角坐标
162
+ const ne = bounds.getNorthEast(); // 东北角坐标
163
+ return {
164
+ southwest: { lat: sw.lat, lng: sw.lng },
165
+ northeast: { lat: ne.lat, lng: ne.lng },
166
+ };
167
+ };
168
+ /* 获取当前地图的旋转角 */
169
+ this._getRotate = () => {
170
+ // 获取地图当前旋转角度
171
+ let rotation = this.rotate;
172
+ if (rotation < 0 || rotation > 360) {
173
+ rotation = 0;
174
+ }
175
+ return rotation;
176
+ };
177
+ /* 获取当前地图的倾斜角 */
178
+ this._getSkew = () => {
179
+ let Skew = this.skew;
180
+ if (Skew < 0 || Skew > 40) {
181
+ Skew = 0;
182
+ }
183
+ return Skew;
184
+ };
185
+ /* 获取当前地图的缩放级别 */
186
+ this._getScale = () => {
187
+ const Scale = this.scale;
188
+ return Scale;
189
+ };
190
+ /* 设置地图中心点偏移,向后向下为增长 */
191
+ this._setCenterOffset = (option) => {
192
+ // 解构获取偏移量参数
193
+ const [x, y] = option.offset;
194
+ // 获取地图尺寸
195
+ const mapSize = this.map.getSize();
196
+ // 计算水平偏移量
197
+ const offsetX = Math.max(0.25 * mapSize.width, Math.min(0.75 * mapSize.width, x * mapSize.width));
198
+ // 计算垂直偏移量
199
+ const offsetY = Math.max(0.25 * mapSize.height, Math.min(0.75 * mapSize.height, y * mapSize.height));
200
+ // 创建像素坐标对象
201
+ const pixel = new BMapGL.Pixel(offsetX, offsetY);
202
+ // 将像素坐标转换为地理坐标
203
+ const center = this.map.pixelToPoint(pixel);
204
+ // 平移地图至指定中心点
205
+ this.map.panTo(center);
206
+ };
207
+ /* 添加 marker */
208
+ this._addMarkers = (option) => {
209
+ if (option.clear) {
210
+ // 清除地图上所有marker
211
+ this.map.clearOverlays(this.markers);
212
+ }
213
+ option.markers.forEach((marker) => {
214
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
215
+ if (marker.latitude && marker.longitude && marker.iconPath) {
216
+ const pt = new BMapGL.Point(marker.longitude, marker.latitude);
217
+ const markerObj = new BMapGL.Marker(pt, { enableClicking: true });
218
+ this.map.addOverlay(markerObj);
219
+ markerObj.id = marker.id; // 设置标记点的唯一标识符
220
+ markerObj.alpha = marker.alpha;
221
+ if (marker.zIndex) {
222
+ markerObj.setZIndex(marker.zIndex);
223
+ }
224
+ if (marker.width && marker.height && marker.iconPath) {
225
+ const icon = new BMapGL.Icon(marker.iconPath, new BMapGL.Size(marker.width, marker.height));
226
+ markerObj.setIcon(icon);
227
+ }
228
+ else if (marker.iconPath) {
229
+ const img = new Image();
230
+ img.src = marker.iconPath;
231
+ img.style.opacity = String(marker.alpha);
232
+ img.onload = () => {
233
+ const iconSize = new BMapGL.Size(img.width, img.height);
234
+ const icon = new BMapGL.Icon(img.src, iconSize);
235
+ icon.imageOffset = new BMapGL.Size(0, 0, marker.alpha || 1);
236
+ markerObj.setIcon(icon);
237
+ };
238
+ }
239
+ else {
240
+ console.error('没有找到iconPath图片路径');
241
+ return;
242
+ }
243
+ const rotate = marker.rotate ? marker.rotate : 0;
244
+ if (rotate) {
245
+ markerObj.setRotation(rotate);
246
+ }
247
+ if (marker.anchor) {
248
+ const offsetX = ((_b = (_a = marker.anchor) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0) * (marker.width || 0);
249
+ const offsetY = ((_d = (_c = marker.anchor) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0) * (marker.height || 0);
250
+ markerObj.setOffset(new BMapGL.Size(offsetX, offsetY));
251
+ }
252
+ // 创建title
253
+ if (!marker.callout && marker.title) {
254
+ const hammer = new Hammer(this.mapRef); // 创建Hammer对象,绑定到地图容器
255
+ hammer.on('tap', (e) => {
256
+ // 使用tap事件替代click事件
257
+ const touch = e.center;
258
+ const x = touch.x;
259
+ const y = touch.y;
260
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
261
+ const threshold = 15;
262
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
263
+ option.markers.forEach((marker) => {
264
+ // 通过class名获取地图容器
265
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
266
+ // 获取地图容器在屏幕上的偏移量
267
+ const mapContainerRect = mapContainer.getBoundingClientRect();
268
+ const mapOffsetX = mapContainerRect.left;
269
+ const mapOffsetY = mapContainerRect.top;
270
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
271
+ const pixel = this.map.pointToPixel(point);
272
+ const markerX = pixel.x + mapOffsetX;
273
+ const markerY = pixel.y + mapOffsetY;
274
+ // 计算触摸位置与标记点的距离
275
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
276
+ if (distance < threshold && marker.id === markerObj.id) {
277
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
278
+ const content = `<div style="text-align:center">${marker.title}</div>`;
279
+ const infoWindow = new BMapGL.InfoWindow(content);
280
+ this.map.openInfoWindow(infoWindow, pt);
281
+ }
282
+ });
283
+ });
284
+ }
285
+ if (marker.callout) {
286
+ 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; // 横向偏移量
287
+ 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; // 纵向偏移量
288
+ // 创建气泡(callout)对象
289
+ const callout = new BMapGL.InfoWindow(`<div style="
290
+ padding: ${(_j = marker.callout) === null || _j === void 0 ? void 0 : _j.padding}px;
291
+ color:${(_k = marker.callout) === null || _k === void 0 ? void 0 : _k.color};
292
+ text-align:${(_l = marker.callout) === null || _l === void 0 ? void 0 : _l.textAlign};"
293
+ >
294
+ <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>
295
+ </div>`, {
296
+ width: 200,
297
+ height: 100,
298
+ offset: new BMapGL.Size(offsetX - 24, offsetY - 20), // 设置偏移量
299
+ });
300
+ // 自定义属性存储气泡(callout)对象
301
+ markerObj.callout = callout;
302
+ // 将气泡(callout)对象绑定到标记(marker)对象上
303
+ this.map.addOverlay(markerObj);
304
+ if (((_p = marker.callout) === null || _p === void 0 ? void 0 : _p.display) === 'ALWAYS') {
305
+ markerObj.callout.disableCloseOnClick();
306
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
307
+ markerObj.callout.addEventListener('open', function () {
308
+ var _a, _b, _c, _d;
309
+ console.log(markerObj.callout);
310
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
311
+ if (infoWindowElement) {
312
+ let triangle = infoWindowElement.querySelector('.triangle');
313
+ if (!triangle) {
314
+ // 如果不存在,则创建并添加新的三角形 div
315
+ triangle = document.createElement('div');
316
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
317
+ infoWindowElement.appendChild(triangle);
318
+ }
319
+ const img = document.querySelector('.BMap_bubble_pop>img');
320
+ if (img) {
321
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
322
+ }
323
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
324
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
325
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
326
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
327
+ // 确保边框大小不超过15
328
+ borderWidth = Math.min(borderWidth, 15);
329
+ 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`);
330
+ 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; `);
331
+ }
332
+ });
333
+ this.map.openInfoWindow(markerObj.callout, pt);
334
+ }
335
+ else {
336
+ const hammer = new Hammer(this.mapRef); // 创建Hammer对象,绑定到地图容器
337
+ hammer.on('tap', (e) => {
338
+ // 使用tap事件替代click事件
339
+ const touch = e.center;
340
+ const x = touch.x;
341
+ const y = touch.y;
342
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
343
+ const threshold = 15;
344
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
345
+ option.markers.forEach((marker) => {
346
+ // 通过class名获取地图容器
347
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
348
+ // 获取地图容器在屏幕上的偏移量
349
+ const mapContainerRect = mapContainer.getBoundingClientRect();
350
+ const mapOffsetX = mapContainerRect.left;
351
+ const mapOffsetY = mapContainerRect.top;
352
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
353
+ const pixel = this.map.pointToPixel(point);
354
+ const markerX = pixel.x + mapOffsetX;
355
+ const markerY = pixel.y + mapOffsetY;
356
+ // 计算触摸位置与标记点的距离
357
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
358
+ if (distance < threshold && marker.id === markerObj.id) {
359
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
360
+ markerObj.callout.addEventListener('open', function () {
361
+ var _a, _b, _c, _d;
362
+ console.log(markerObj.callout);
363
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
364
+ if (infoWindowElement) {
365
+ let triangle = infoWindowElement.querySelector('.triangle');
366
+ if (!triangle) {
367
+ // 如果不存在,则创建并添加新的三角形 div
368
+ triangle = document.createElement('div');
369
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
370
+ infoWindowElement.appendChild(triangle);
371
+ }
372
+ const img = document.querySelector('.BMap_bubble_pop>img');
373
+ if (img) {
374
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
375
+ }
376
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
377
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
378
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
379
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
380
+ // 确保边框大小不超过15
381
+ borderWidth = Math.min(borderWidth, 15);
382
+ 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`);
383
+ 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; `);
384
+ }
385
+ });
386
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
387
+ this.map.openInfoWindow(markerObj.callout, pt);
388
+ }
389
+ else {
390
+ markerObj.callout.enableCloseOnClick();
391
+ // 用户点击到了地图上的其他位置,不是标记点
392
+ }
393
+ });
394
+ });
395
+ }
396
+ }
397
+ // 判断是否有label属性
398
+ if (marker.label) {
399
+ const labelContent = marker.label.content || '';
400
+ const labelOpts = {
401
+ position: pt,
402
+ offset: new BMapGL.Size(marker.label.anchorX || 0, marker.label.anchorY || 0),
403
+ };
404
+ const label = new BMapGL.Label(labelContent, labelOpts);
405
+ // 设置标签样式
406
+ label.setStyle({
407
+ color: marker.label.color,
408
+ fontSize: marker.label.fontSize + 'px',
409
+ borderWidth: marker.label.borderWidth + 'px',
410
+ borderColor: marker.label.borderColor,
411
+ borderRadius: marker.label.borderRadius + 'px',
412
+ background: marker.label.bgColor,
413
+ padding: marker.label.padding + 'px',
414
+ });
415
+ markerObj.setLabel(label);
416
+ }
417
+ }
418
+ });
419
+ };
420
+ /* 移除 marker */
421
+ this._removeMarkers = (option) => {
422
+ // 获取所有覆盖物
423
+ const overlays = this.map.getOverlays();
424
+ let newTargetMarker = {};
425
+ option.markerIds.forEach((id) => {
426
+ // 查找指定 id 的 Marker 对象
427
+ const targetMarker = overlays.find((overlay) => overlay instanceof BMapGL.Marker && String(overlay.id) === id);
428
+ newTargetMarker = targetMarker;
429
+ this.map.removeOverlay(targetMarker);
430
+ });
431
+ return newTargetMarker;
432
+ };
433
+ /* 沿指定路径移动 marker,用于轨迹回放等场景。动画完成时触发回调事件,若动画进行中,对同一 marker 再次调用 moveAlong 方法,前一次的动画将被打断 */
434
+ this._moveAlong = (object) => {
435
+ const path = object.path;
436
+ const targetMarkerId = object.markerId;
437
+ const duration = object.duration;
438
+ const autoRotate = object.autoRotate;
439
+ const targetMarker = this.map.getOverlays().find((overlay) => overlay instanceof BMapGL.Marker && overlay.id === targetMarkerId);
440
+ const points = path.map((p) => new BMapGL.Point(p.longitude, p.latitude));
441
+ const obj = {
442
+ flagId: true,
443
+ flagCoordinate: true // 标记是否有有效经纬度
444
+ };
445
+ if (!targetMarker) {
446
+ console.error(`Marker "${targetMarkerId}" not found.`);
447
+ obj.flagId = false;
448
+ return obj;
449
+ }
450
+ for (let i = 0; i < points.length; i++) {
451
+ const point = points[i];
452
+ if (point.lat < -80 && point.lat >= -90) {
453
+ point.lat += 10;
454
+ }
455
+ if (point.lng < -180 || point.lng > 180 || point.lat < -90 || point.lat > 90 || isNaN(point.lng) || isNaN(point.lat)) {
456
+ obj.flagCoordinate = false;
457
+ return obj;
458
+ }
459
+ }
460
+ if (obj.flagId && obj.flagCoordinate) {
461
+ const startTime = performance.now();
462
+ const animate = (timestamp) => {
463
+ const elapsedTime = timestamp - startTime;
464
+ const progress = Math.min(elapsedTime / duration, 1);
465
+ const currentPoint = this.getPointOnPath(points, progress);
466
+ targetMarker.setPosition(currentPoint);
467
+ if (autoRotate && progress < 1) {
468
+ const nextPoint = this.getPointOnPath(points, Math.min(progress + 0.01, 1)); // 获取前进一点的点
469
+ const rotation = this.calculateRotation(currentPoint, nextPoint);
470
+ targetMarker.setRotation(rotation);
471
+ }
472
+ if (progress < 1) {
473
+ requestAnimationFrame(animate);
474
+ }
475
+ else {
476
+ // 动画结束
477
+ targetMarker.setPosition(points[points.length - 1]); // 设置 marker 位置为路径的最后一个点
478
+ targetMarker.setRotation(0); // 恢复旋转角度为0
479
+ }
480
+ };
481
+ requestAnimationFrame(animate);
482
+ }
483
+ return obj;
484
+ };
485
+ this.getPointOnPath = (points, progress) => {
486
+ const totalLength = this.calculateTotalLength(points);
487
+ const targetLength = totalLength * progress;
488
+ let currentLength = 0;
489
+ for (let i = 0; i < points.length - 1; i++) {
490
+ const segmentLength = this.map.getDistance(points[i], points[i + 1]);
491
+ if (currentLength + segmentLength >= targetLength) {
492
+ const ratio = (targetLength - currentLength) / segmentLength;
493
+ const deltaX = points[i + 1].lng - points[i].lng;
494
+ const deltaY = points[i + 1].lat - points[i].lat;
495
+ const newLng = points[i].lng + deltaX * ratio;
496
+ const newLat = points[i].lat + deltaY * ratio;
497
+ return new BMapGL.Point(newLng, newLat);
498
+ }
499
+ currentLength += segmentLength;
500
+ }
501
+ // 如果进度超出路径长度,返回路径的最后一个点
502
+ return points[points.length - 1];
503
+ };
504
+ this.calculateTotalLength = (points) => {
505
+ let totalLength = 0;
506
+ for (let i = 0; i < points.length - 1; i++) {
507
+ totalLength += this.map.getDistance(points[i], points[i + 1]);
508
+ }
509
+ return totalLength;
510
+ };
511
+ this.calculateRotation = (currentPoint, nextPoint) => {
512
+ const dx = nextPoint.lng - currentPoint.lng;
513
+ const dy = nextPoint.lat - currentPoint.lat;
514
+ let angle = Math.atan2(dy, dx) * (180 / Math.PI);
515
+ angle = 90 - angle;
516
+ return angle;
517
+ };
518
+ /* 创建自定义图片图层,图片会随着地图缩放而缩放 */
519
+ this._addGroundOverlay = (option) => {
520
+ const { src, opacity, bounds, visible, id, zIndex } = option;
521
+ let flag = true;
522
+ if (bounds.southwest.longitude >= bounds.northeast.longitude || bounds.southwest.latitude >= bounds.northeast.latitude) {
523
+ flag = false;
524
+ return;
525
+ }
526
+ 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)) {
527
+ flag = false;
528
+ return;
529
+ }
530
+ 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)) {
531
+ flag = false;
532
+ return;
533
+ }
534
+ // 创建覆盖物边界对象
535
+ const overlayBounds = new BMapGL.Bounds(new BMapGL.Point(bounds.southwest.longitude, bounds.southwest.latitude), new BMapGL.Point(bounds.northeast.longitude, bounds.northeast.latitude));
536
+ // 定义 GroundOverlay类
537
+ function GroundOverlay(bounds, imageUrl, map, visible, opacity, zIndex, id) {
538
+ this._bounds = bounds;
539
+ this._imageUrl = imageUrl;
540
+ this._map = map;
541
+ this._visible = visible;
542
+ this._opacity = opacity;
543
+ this._zIndex = zIndex;
544
+ this._id = id;
545
+ }
546
+ // 继承 BMapGL.Overlay
547
+ GroundOverlay.prototype = new BMapGL.Overlay();
548
+ // 初始化方法
549
+ GroundOverlay.prototype.initialize = function (map) {
550
+ // 移除已存在的元素
551
+ if (document.getElementById(this._id)) {
552
+ const element = document.getElementById(this._id);
553
+ element === null || element === void 0 ? void 0 : element.remove();
554
+ }
555
+ this._map = map;
556
+ if (!this._div) {
557
+ // 创建 div 元素并设置样式
558
+ const div = document.createElement('div');
559
+ div.id = this._id;
560
+ div.style.position = 'absolute';
561
+ div.style.border = 'none';
562
+ div.style.zIndex = this._zIndex;
563
+ // 创建 img 元素并设置样式
564
+ const img = document.createElement('img');
565
+ img.src = this._imageUrl;
566
+ // 确保opacity值在0到1之间
567
+ const validOpacity = (this._opacity < 0) ? '1' : this._opacity;
568
+ img.style.opacity = validOpacity;
569
+ div.appendChild(img);
570
+ this._div = div;
571
+ }
572
+ // 监听地图缩放事件,调整覆盖物尺寸
573
+ map.addEventListener('zoomend', () => {
574
+ const swPixel = map.pointToOverlayPixel(this._bounds.getSouthWest());
575
+ const nePixel = map.pointToOverlayPixel(this._bounds.getNorthEast());
576
+ const width = nePixel.x - swPixel.x;
577
+ const height = swPixel.y - nePixel.y;
578
+ this._div.style.width = width + 'px';
579
+ this._div.style.height = height + 'px';
580
+ const img = this._div.querySelector('img');
581
+ img.style.width = width + 'px';
582
+ img.style.height = height + 'px';
583
+ });
584
+ // 将 div 元素添加到地图覆盖物层
585
+ map.getPanes().labelPane.appendChild(this._div);
586
+ return this._div;
587
+ };
588
+ // 绘制方法
589
+ GroundOverlay.prototype.draw = function () {
590
+ // 设置 div 元素位置和尺寸
591
+ const _northeast = {
592
+ lat: option.bounds.northeast.latitude,
593
+ lng: option.bounds.southwest.longitude
594
+ };
595
+ const position = this._map.pointToOverlayPixel(_northeast);
596
+ this._div.style.left = position.x + 'px';
597
+ this._div.style.top = position.y + 'px';
598
+ const bounds = this._map.getBounds();
599
+ const sw = this._map.pointToPixel(bounds.getSouthWest());
600
+ const ne = this._map.pointToPixel(bounds.getNorthEast());
601
+ const width = ne.x - sw.x;
602
+ const height = ne.y - sw.y;
603
+ const zoom = this._map.getZoom();
604
+ const imageWidth = width * Math.pow(2, 18 - zoom);
605
+ const imageHeight = height * Math.pow(2, 18 - zoom);
606
+ this._div.style.width = imageWidth + 'px';
607
+ this._div.style.height = imageHeight + 'px';
608
+ this._div.style.display = this._visible ? 'block' : 'none';
609
+ const validOpacity = (this._opacity < 0) ? '1' : this._opacity;
610
+ this._div.getElementsByTagName('img')[0].style.opacity = validOpacity;
611
+ };
612
+ // 创建 GroundOverlay 实例
613
+ const overlay = new GroundOverlay(overlayBounds, src, this.map, visible, opacity, zIndex, id);
614
+ this.map.addOverlay(overlay);
615
+ // 对所有覆盖物进行排序
616
+ const overlays = this.map.getOverlays().sort((a, b) => a._zIndex - b._zIndex);
617
+ this.groundOverlay = overlay;
618
+ // 将所有覆盖物重新绘制
619
+ overlays.forEach((overlay) => overlay.draw());
620
+ const zoom = this.map.getZoom();
621
+ if (zoom < 20) {
622
+ this.map.setZoom(zoom + 1);
623
+ this.map.setZoom(zoom);
624
+ }
625
+ else {
626
+ this.map.setZoom(zoom - 1);
627
+ this.map.setZoom(zoom);
628
+ }
629
+ return flag;
630
+ };
631
+ /* 更新自定义图片图层 */
632
+ this._updateGroundOverlay = (option) => {
633
+ const { src, opacity, bounds, visible, id, zIndex } = option;
634
+ let obj;
635
+ let flagId = true; // 标记是否有id
636
+ let flagCoordinate = true; // 标记是否有有效经纬度
637
+ let flagObj = {};
638
+ // 获取所有图层
639
+ const overlays = this.map.getOverlays();
640
+ // 找到要更新的图层
641
+ const targetOverlay = overlays.find((overlay) => overlay._id === id);
642
+ if (!targetOverlay) {
643
+ flagId = false;
644
+ flagObj = {
645
+ flagId: flagId,
646
+ flagCoordinate: flagCoordinate
647
+ };
648
+ obj = Object.assign({}, flagObj);
649
+ return obj;
650
+ }
651
+ if (bounds.southwest.longitude >= bounds.northeast.longitude || bounds.southwest.latitude >= bounds.northeast.latitude) {
652
+ flagCoordinate = false;
653
+ flagObj = {
654
+ flagId: flagId,
655
+ flagCoordinate: flagCoordinate
656
+ };
657
+ obj = Object.assign({}, flagObj);
658
+ }
659
+ 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)) {
660
+ flagCoordinate = false;
661
+ flagObj = {
662
+ flagId: flagId,
663
+ flagCoordinate: flagCoordinate
664
+ };
665
+ obj = Object.assign({}, flagObj);
666
+ }
667
+ 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)) {
668
+ flagCoordinate = false;
669
+ flagObj = {
670
+ flagId: flagId,
671
+ flagCoordinate: flagCoordinate
672
+ };
673
+ obj = Object.assign({}, flagObj);
674
+ }
675
+ if (flagId && flagCoordinate) {
676
+ const targetBounds = new BMapGL.Bounds(new BMapGL.Point(bounds.southwest.longitude, bounds.southwest.latitude), new BMapGL.Point(bounds.northeast.longitude, bounds.northeast.latitude));
677
+ const zoom = this.map.getZoom();
678
+ if (targetOverlay) {
679
+ // 更新DOM元素
680
+ const element = document.getElementById(id);
681
+ if (element) {
682
+ const imgElement = element.querySelector('img');
683
+ if (imgElement) {
684
+ // 找到了对应的元素
685
+ const validOpacity = (opacity < 0) ? '1' : opacity;
686
+ element.style.opacity = validOpacity;
687
+ imgElement.style.display = visible ? 'block' : 'none';
688
+ element.style.zIndex = zIndex;
689
+ // 加载图片
690
+ const image = new Image();
691
+ image.onload = () => {
692
+ // 图片加载完成后执行
693
+ imgElement.src = src; // 设置图片的src
694
+ // 根据当前缩放级别设置图片宽高
695
+ const lngSpan = targetBounds.getNorthEast().lng - targetBounds.getSouthWest().lng;
696
+ const mapWidth = this.map.getSize().width; // 获取地图容器的宽度
697
+ const updatedImageWidth = (mapWidth / Math.pow(2, 18 - zoom)) * lngSpan;
698
+ const imageAspectRatio = image.naturalHeight / image.naturalWidth;
699
+ const updatedImageHeight = updatedImageWidth * imageAspectRatio;
700
+ imgElement.style.width = `${updatedImageWidth}px`;
701
+ imgElement.style.height = `${updatedImageHeight}px`;
702
+ // 重新绘制图层
703
+ targetOverlay._bounds = targetBounds;
704
+ targetOverlay.draw();
705
+ // 更新完图片后,立即重绘地图
706
+ this.map.panTo(this.map.getCenter());
707
+ targetOverlay.draw();
708
+ };
709
+ image.src = src;
710
+ }
711
+ }
712
+ }
713
+ else {
714
+ // 没有找到对应的元素
715
+ console.error(`未找到id为${id}的元素`);
716
+ }
717
+ flagObj = {
718
+ flagId: flagId,
719
+ flagCoordinate: flagCoordinate
720
+ };
721
+ obj = Object.assign({}, flagObj);
722
+ return obj;
723
+ }
724
+ else {
725
+ return obj;
726
+ }
727
+ };
728
+ /* 移除自定义图片图层 */
729
+ this._removeGroundOverlay = (option) => {
730
+ // 获取所有图层
731
+ const overlays = this.map.getOverlays();
732
+ let newTargetOverlay = '';
733
+ // 找到要更新的图层
734
+ const targetOverlay = overlays.find((overlay) => overlay._id === option.id);
735
+ newTargetOverlay = targetOverlay;
736
+ if (targetOverlay) {
737
+ // 如果找到了对应的图层,执行删除操作
738
+ this.map.removeOverlay(targetOverlay);
739
+ }
740
+ return newTargetOverlay;
741
+ };
742
+ /* 限制地图的显示范围。此接口同时会限制地图的最小缩放整数级别。 */
743
+ this._setBoundary = (option) => {
744
+ let nth = option.northeast.latitude;
745
+ let sth = option.southwest.latitude;
746
+ let flag = true;
747
+ if (option.northeast.latitude <= -80 && option.northeast.latitude >= -90) {
748
+ nth = option.northeast.latitude + 10;
749
+ }
750
+ if (option.southwest.latitude <= -80 && option.southwest.latitude >= -90) {
751
+ sth = option.southwest.latitude + 10;
752
+ }
753
+ 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) {
754
+ flag = false;
755
+ return;
756
+ }
757
+ 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)) {
758
+ flag = false;
759
+ return;
760
+ }
761
+ const ne = new BMapGL.Point(option.northeast.longitude, nth);
762
+ const sw = new BMapGL.Point(option.southwest.longitude, sth);
763
+ const bounds = new BMapGL.Bounds(sw, ne);
764
+ const viewport = this.map.getViewport([ne, sw]);
765
+ this.map.centerAndZoom(new BMapGL.Point(viewport.center.lng, viewport.center.lat), viewport.zoom + 2);
766
+ this.map.addOverlay(new BMapGL.Polygon([
767
+ new BMapGL.Point(bounds.sw.lng, bounds.sw.lat),
768
+ new BMapGL.Point(bounds.sw.lng, bounds.ne.lat),
769
+ new BMapGL.Point(bounds.ne.lng, bounds.ne.lat),
770
+ new BMapGL.Point(bounds.ne.lng, bounds.sw.lat)
771
+ ], {
772
+ fillOpacity: 0
773
+ }));
774
+ BMapGLLib.AreaRestriction.setBounds(this.map, bounds);
775
+ return flag;
776
+ };
777
+ this.latitude = undefined;
778
+ this.longitude = undefined;
779
+ this.scale = undefined;
780
+ this.minScale = undefined;
781
+ this.maxScale = undefined;
782
+ this.markers = undefined;
783
+ this.polyline = undefined;
784
+ this.circles = undefined;
785
+ this.polygons = undefined;
786
+ this.subkey = undefined;
787
+ this.layerStyle = undefined;
788
+ this.rotate = undefined;
789
+ this.skew = undefined;
790
+ this.showCompass = undefined;
791
+ this.showScale = undefined;
792
+ this.enableOverlooking = undefined;
793
+ this.enableZoom = undefined;
794
+ this.enableScroll = undefined;
795
+ this.enableRotate = undefined;
796
+ this.enableSatellite = undefined;
797
+ this.enableTraffic = undefined;
798
+ this.enableBuilding = undefined;
799
+ this.enableAutoMaxOverlooking = undefined;
800
+ this.enable3D = undefined;
801
+ this.width = '100%';
802
+ this.height = '100%';
803
+ }
804
+ async componentDidLoad() {
805
+ // 加载地图脚本
806
+ await this.loadMapScript();
807
+ // 记载BmapLib工具库
808
+ await this.LoadBmapLibScript();
809
+ // 如果容器元素存在
810
+ if (this.mapRef) {
811
+ this.mapRef.addEventListener('touchmove', (e) => {
812
+ if (e.cancelable) {
813
+ e.preventDefault();
814
+ }
815
+ });
816
+ // 创建地图对象
817
+ this.map = new BMapGL.Map(this.mapRef);
818
+ // 移除百度地图版权信息
819
+ this.map.removeControl(this.map.getMapType());
820
+ // 创建中心点坐标对象
821
+ // 中心经纬度为必填值
822
+ if (this.latitude < -90 || this.latitude > 90 || this.longitude < -180 || this.longitude > 180 || isNaN(this.latitude) || isNaN(this.longitude)) {
823
+ console.error('请正确设置中心经纬度');
824
+ return;
825
+ }
826
+ let scale = isNaN(this.scale) ? 16 : this.scale;
827
+ let minScale = isNaN(this.minScale) ? 3 : this.minScale;
828
+ let maxScale = isNaN(this.maxScale) ? 16 : this.maxScale;
829
+ const point = new BMapGL.Point(this.longitude, this.latitude);
830
+ if (minScale < 3 || minScale > 20) {
831
+ minScale = 3;
832
+ this.map.setMinZoom(3);
833
+ }
834
+ else {
835
+ // 设置最小缩放级别
836
+ this.map.setMinZoom(minScale);
837
+ }
838
+ if (maxScale > 20 || maxScale < 3) {
839
+ maxScale = 20;
840
+ this.map.setMaxZoom(20);
841
+ }
842
+ else {
843
+ // 设置最大缩放级别
844
+ this.map.setMaxZoom(maxScale);
845
+ }
846
+ if (minScale > maxScale) {
847
+ minScale = 3;
848
+ this.map.setMinZoom(3);
849
+ maxScale = 20;
850
+ this.map.setMaxZoom(20);
851
+ }
852
+ // 设置地图中心和缩放级别
853
+ if (minScale <= 16 && maxScale >= 16) {
854
+ if (scale >= minScale && scale <= maxScale) {
855
+ // 使用this.scale来设置缩放级别
856
+ this.map.centerAndZoom(point, scale);
857
+ }
858
+ else {
859
+ scale = 16;
860
+ this.map.centerAndZoom(point, scale);
861
+ }
862
+ }
863
+ else {
864
+ if (scale >= minScale && scale <= maxScale) {
865
+ // 使用this.scale来设置缩放级别
866
+ this.map.centerAndZoom(point, scale);
867
+ }
868
+ else if (scale < minScale) {
869
+ scale = minScale;
870
+ this.map.centerAndZoom(point, minScale);
871
+ }
872
+ else {
873
+ scale = maxScale;
874
+ this.map.centerAndZoom(point, maxScale);
875
+ }
876
+ }
877
+ // 添加标记点markers
878
+ if (Array.isArray(this.markers)) {
879
+ this.addMarkers(this.markers);
880
+ }
881
+ // 创建polyline路线
882
+ if (Array.isArray(this.polyline)) {
883
+ this.polyline.forEach((line) => {
884
+ if (line.points) {
885
+ const points = line.points.map((point) => new BMapGL.Point(point.longitude, point.latitude));
886
+ const polyline = new BMapGL.Polyline(points, {
887
+ strokeColor: line.color,
888
+ strokeWeight: line.width,
889
+ strokeStyle: line.dottedLine ? 'dashed' : 'solid',
890
+ strokeOpacity: 1,
891
+ });
892
+ // 将polyline路线添加到地图上
893
+ this.map.addOverlay(polyline);
894
+ }
895
+ });
896
+ }
897
+ // 添加圆形覆盖物circles
898
+ if (Array.isArray(this.circles)) {
899
+ this.circles.forEach((circle) => {
900
+ if (circle.latitude && circle.longitude && circle.radius) {
901
+ const point = new BMapGL.Point(circle.longitude, circle.latitude);
902
+ const circleObj = new BMapGL.Circle(point, circle.radius, {
903
+ strokeColor: circle.color,
904
+ fillColor: circle.fillColor,
905
+ strokeWeight: circle.strokeWidth,
906
+ });
907
+ this.map.addOverlay(circleObj);
908
+ }
909
+ });
910
+ }
911
+ // 多边形
912
+ if (Array.isArray(this.polygons)) {
913
+ this.polygons.forEach((polygon) => {
914
+ // 创建多边形的点坐标数组
915
+ const points = polygon.points.map((point) => new BMapGL.Point(point.longitude, point.latitude));
916
+ // 创建多边形对象
917
+ const polygonObj = new BMapGL.Polygon(points, {
918
+ strokeColor: polygon.strokeColor,
919
+ fillColor: polygon.fillColor,
920
+ strokeWeight: polygon.strokeWidth,
921
+ });
922
+ // 将多边形添加到地图上
923
+ this.map.addOverlay(polygonObj);
924
+ });
925
+ }
926
+ if (this.layerStyle === 0) {
927
+ const layerStyle = this.layerStyle;
928
+ if (layerStyle) {
929
+ // 使用个性化地图样式
930
+ this.map.setMapStyleV2({ styleId: this.subkey });
931
+ }
932
+ }
933
+ else {
934
+ const layerStyle = this.layerStyle ? this.layerStyle : 1;
935
+ if (layerStyle === 1) {
936
+ // 使用个性化地图样式
937
+ this.map.setMapStyleV2({ styleId: this.subkey });
938
+ }
939
+ }
940
+ const enable3D = this.enable3D === true ? this.enable3D : false;
941
+ const enableOverlooking = this.enableOverlooking === true ? this.enableOverlooking : false;
942
+ const enableAutoMaxOverlooking = this.enableAutoMaxOverlooking === true ? this.enableAutoMaxOverlooking : false;
943
+ const skew = this.skew ? this.skew : 0;
944
+ if (enable3D === true) {
945
+ if (enableOverlooking === true) {
946
+ // /开启最大俯视角
947
+ if (enableAutoMaxOverlooking === true) {
948
+ this.map.setTilt(75);
949
+ }
950
+ else {
951
+ // 开启俯视角度
952
+ this.map.setTilt(45);
953
+ }
954
+ }
955
+ else if (skew >= 0 && skew <= 40) {
956
+ // 设置倾斜角度
957
+ this.map.setTilt(skew);
958
+ }
959
+ else {
960
+ this.map.setTilt(0);
961
+ }
962
+ }
963
+ else {
964
+ this.map.setTilt(0);
965
+ }
966
+ // 显示指南针
967
+ const showCompass = this.showCompass === true ? this.showCompass : false;
968
+ if (showCompass === true) {
969
+ const compassControl = new BMapGL.NavigationControl3D({
970
+ anchor: BMAP_ANCHOR_TOP_RIGHT,
971
+ type: 3, // 3代表显示指南针
972
+ });
973
+ this.map.addControl(compassControl);
974
+ }
975
+ // 显示比例尺
976
+ const showScale = this.showScale === true ? this.showScale : false;
977
+ if (showScale === true) {
978
+ const scaleControl = new BMapGL.ScaleControl({
979
+ anchor: BMAP_ANCHOR_BOTTOM_RIGHT,
980
+ });
981
+ this.map.addControl(scaleControl);
982
+ }
983
+ const enableZoom = this.enableZoom === false ? this.enableZoom : true;
984
+ if (enableZoom === true) {
985
+ // 启用缩放
986
+ this.map.enableScrollWheelZoom(this.enableZoom);
987
+ }
988
+ // 启用缩放
989
+ if (this.enableZoom === true && this.mapRef) {
990
+ this.map.enablePinchToZoom();
991
+ }
992
+ else {
993
+ this.map.disablePinchToZoom();
994
+ }
995
+ // 拖拽
996
+ const enableScroll = this.enableScroll === false ? this.enableScroll : true;
997
+ if (enableScroll === true) {
998
+ this.map.enableDragging();
999
+ }
1000
+ else {
1001
+ this.map.disableDragging();
1002
+ }
1003
+ const rotate = this.rotate ? this.rotate : 0;
1004
+ if (rotate >= 0 && this.rotate <= 360) {
1005
+ this.map.setHeading(this.rotate);
1006
+ }
1007
+ else {
1008
+ this.map.setHeading(0);
1009
+ }
1010
+ // 设置旋转角度
1011
+ if (this.enableRotate === true) {
1012
+ this.map.enableRotateGestures();
1013
+ }
1014
+ // 启用卫星图
1015
+ const enableSatellite = this.enableSatellite === true ? this.enableSatellite : false;
1016
+ if (enableSatellite === true && this.mapRef) {
1017
+ const mapTypeControl = new BMapGL.MapTypeControl({
1018
+ mapTypes: [BMAP_NORMAL_MAP, BMAP_SATELLITE_MAP],
1019
+ });
1020
+ this.map.addControl(mapTypeControl);
1021
+ }
1022
+ const enableTraffic = this.enableTraffic === true ? this.enableTraffic : false;
1023
+ if (enableTraffic === true && this.mapRef) {
1024
+ this.map.setTrafficOn();
1025
+ }
1026
+ // 是否开启建筑物
1027
+ const enableBuilding = this.enableBuilding === false ? this.enableBuilding : true;
1028
+ if (enableBuilding === false) {
1029
+ this.map.setDisplayOptions({ building: false });
1030
+ }
1031
+ }
1032
+ if (this.map) {
1033
+ // 创建Hammer对象,绑定到地图容器
1034
+ const hammer = new Hammer(this.mapRef);
1035
+ hammer.on('tap', (e) => {
1036
+ // 将Hammer事件对象中的坐标转换为百度地图坐标
1037
+ const point = this.map.pixelToPoint({ x: e.center.x, y: e.center.y });
1038
+ this.onTap.emit({
1039
+ longitude: point.lng,
1040
+ latitude: point.lat,
1041
+ });
1042
+ });
1043
+ }
1044
+ }
1045
+ disconnectedCallback() {
1046
+ if (this.map) {
1047
+ this.map.destroy();
1048
+ }
1049
+ }
1050
+ addMarkers(markers) {
1051
+ // 维护已存在的marker id 列表
1052
+ const existingIds = [];
1053
+ markers.forEach((marker) => {
1054
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1055
+ if (existingIds.includes(marker.id)) {
1056
+ // 如果id已存在,直接返回,不执行后续操作
1057
+ console.error('请输入不同的marker的id');
1058
+ return;
1059
+ }
1060
+ existingIds.push(marker.id);
1061
+ if (marker.latitude && marker.longitude && marker.iconPath && marker.id) {
1062
+ if (marker.latitude < -90 || marker.latitude > 90 || marker.longitude < -180 || marker.longitude > 180) {
1063
+ console.error('请正确设置marker的经纬度');
1064
+ return;
1065
+ }
1066
+ const pt = new BMapGL.Point(marker.longitude, marker.latitude);
1067
+ const markerObj = new BMapGL.Marker(pt, { enableClicking: true });
1068
+ markerObj.id = marker.id; // 设置标记点的唯一标识符
1069
+ markerObj.alpha = marker.alpha;
1070
+ if (marker.zIndex) {
1071
+ markerObj.setZIndex(marker.zIndex);
1072
+ }
1073
+ if (marker.width && marker.height) {
1074
+ const canvas = document.createElement('canvas');
1075
+ canvas.width = marker.width * 2;
1076
+ canvas.height = marker.height * 2;
1077
+ // 获取 Canvas 上下文
1078
+ const ctx = canvas.getContext('2d');
1079
+ // 创建一个新的图片对象
1080
+ const img = new Image();
1081
+ // 设置图片的跨域属性
1082
+ img.crossOrigin = 'Anonymous';
1083
+ img.src = marker.iconPath;
1084
+ // 当图片加载完成后,将其绘制到Canvas上
1085
+ img.onload = function () {
1086
+ ctx.drawImage(img, 0, 0, marker.width * 2, marker.height * 2);
1087
+ // 创建 BMapGL.Icon 对象,并将 Canvas 元素作为图标的内容
1088
+ // 设置锚点偏移量为(0, 0),表示图标的左上角将与经纬度对齐
1089
+ const icon = new BMapGL.Icon(canvas.toDataURL(), new BMapGL.Size(marker.width, marker.height), {
1090
+ anchor: new BMapGL.Size(0, 0)
1091
+ });
1092
+ markerObj.setIcon(icon);
1093
+ };
1094
+ }
1095
+ else {
1096
+ const img = new Image();
1097
+ img.src = marker.iconPath;
1098
+ img.style.opacity = String(marker.alpha);
1099
+ img.onload = () => {
1100
+ const iconSize = new BMapGL.Size(img.width, img.height);
1101
+ const icon = new BMapGL.Icon(img.src, iconSize);
1102
+ icon.imageOffset = new BMapGL.Size(0, 0, marker.alpha || 1);
1103
+ markerObj.setIcon(icon);
1104
+ };
1105
+ }
1106
+ const rotate = marker.rotate ? marker.rotate : 0;
1107
+ if (rotate >= 0 && rotate <= 360) {
1108
+ markerObj.setRotation(rotate);
1109
+ }
1110
+ // 如果anchor.x和anchor.y被定义,则使用它们的值,否则使用默认值
1111
+ const anchorX = (_b = (_a = marker.anchor) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0.5;
1112
+ const anchorY = (_d = (_c = marker.anchor) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 1;
1113
+ if (anchorX >= 0 && anchorX <= 1 && anchorY >= 0 && anchorY <= 1) {
1114
+ // 锚点设置为图标宽度的负值乘以x,以向左移动
1115
+ const offsetX = -(anchorX) * (marker.width || 0);
1116
+ // 锚点设置为图标高度的负值乘以y,以向上移动
1117
+ const offsetY = -(anchorY) * (marker.height || 0);
1118
+ // 使用计算出的偏移量设置标注对象的偏移
1119
+ markerObj.setOffset(new BMapGL.Size(offsetX, offsetY));
1120
+ }
1121
+ else {
1122
+ const offsetX = -0.5 * (marker.width || 0);
1123
+ const offsetY = -1 * (marker.height || 0);
1124
+ markerObj.setOffset(new BMapGL.Size(offsetX, offsetY));
1125
+ }
1126
+ // 创建title
1127
+ if (!marker.callout && marker.title) {
1128
+ const hammer = new Hammer(this.mapRef); // 创建Hammer对象,绑定到地图容器
1129
+ hammer.on('tap', (e) => {
1130
+ // 使用tap事件替代click事件
1131
+ const touch = e.center;
1132
+ const x = touch.x;
1133
+ const y = touch.y;
1134
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
1135
+ const threshold = 15;
1136
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
1137
+ this.markers.forEach((marker) => {
1138
+ // 通过class名获取地图容器
1139
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
1140
+ // 获取地图容器在屏幕上的偏移量
1141
+ const mapContainerRect = mapContainer.getBoundingClientRect();
1142
+ const mapOffsetX = mapContainerRect.left;
1143
+ const mapOffsetY = mapContainerRect.top;
1144
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
1145
+ const pixel = this.map.pointToPixel(point);
1146
+ const markerX = pixel.x + mapOffsetX;
1147
+ const markerY = pixel.y + mapOffsetY;
1148
+ // 计算触摸位置与标记点的距离
1149
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
1150
+ if (distance < threshold && marker.id === markerObj.id) {
1151
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
1152
+ const content = `<div style="text-align:center">${marker.title}</div>`;
1153
+ const infoWindow = new BMapGL.InfoWindow(content);
1154
+ this.map.openInfoWindow(infoWindow, pt);
1155
+ }
1156
+ });
1157
+ });
1158
+ }
1159
+ if (marker.callout) {
1160
+ 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; // 横向偏移量
1161
+ 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; // 纵向偏移量
1162
+ // 创建气泡(callout)对象
1163
+ const callout = new BMapGL.InfoWindow(`<div style="
1164
+ padding: ${(_j = marker.callout) === null || _j === void 0 ? void 0 : _j.padding}px;
1165
+ color:${(_k = marker.callout) === null || _k === void 0 ? void 0 : _k.color};
1166
+ text-align:${(_l = marker.callout) === null || _l === void 0 ? void 0 : _l.textAlign};"
1167
+ >
1168
+ <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>
1169
+ </div>`, {
1170
+ width: 200,
1171
+ height: 100,
1172
+ offset: new BMapGL.Size(offsetX - 24, offsetY - 20), // 设置偏移量
1173
+ });
1174
+ // 自定义属性存储气泡(callout)对象
1175
+ markerObj.callout = callout;
1176
+ // 将气泡(callout)对象绑定到标记(marker)对象上
1177
+ this.map.addOverlay(markerObj);
1178
+ if (((_p = marker.callout) === null || _p === void 0 ? void 0 : _p.display) === 'ALWAYS') {
1179
+ markerObj.callout.disableCloseOnClick();
1180
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
1181
+ markerObj.callout.addEventListener('open', function () {
1182
+ var _a, _b, _c, _d;
1183
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
1184
+ if (infoWindowElement) {
1185
+ let triangle = infoWindowElement.querySelector('.triangle');
1186
+ if (!triangle) {
1187
+ // 如果不存在,则创建并添加新的三角形 div
1188
+ triangle = document.createElement('div');
1189
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
1190
+ infoWindowElement.appendChild(triangle);
1191
+ }
1192
+ const img = document.querySelector('.BMap_bubble_pop>img');
1193
+ if (img) {
1194
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
1195
+ }
1196
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
1197
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
1198
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
1199
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
1200
+ // 确保边框大小不超过15
1201
+ borderWidth = Math.min(borderWidth, 15);
1202
+ 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`);
1203
+ 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; `);
1204
+ }
1205
+ });
1206
+ this.map.openInfoWindow(markerObj.callout, pt);
1207
+ }
1208
+ else {
1209
+ const hammer = new Hammer(this.mapRef); // 创建Hammer对象,绑定到地图容器
1210
+ hammer.on('tap', (e) => {
1211
+ // 使用tap事件替代click事件
1212
+ const touch = e.center;
1213
+ const x = touch.x;
1214
+ const y = touch.y;
1215
+ // 假设阈值为 10,表示点击距离小于 10 个像素时认为是点击到了标记点
1216
+ const threshold = 15;
1217
+ // 遍历标记点数组,计算触摸位置与每个标记点的距离
1218
+ this.markers.forEach((marker) => {
1219
+ // 通过class名获取地图容器
1220
+ const mapContainer = document.getElementsByClassName('bmap-container')[0];
1221
+ // 获取地图容器在屏幕上的偏移量
1222
+ const mapContainerRect = mapContainer.getBoundingClientRect();
1223
+ const mapOffsetX = mapContainerRect.left;
1224
+ const mapOffsetY = mapContainerRect.top;
1225
+ const point = new BMapGL.Point(marker.longitude, marker.latitude);
1226
+ const pixel = this.map.pointToPixel(point);
1227
+ const markerX = pixel.x + mapOffsetX;
1228
+ const markerY = pixel.y + mapOffsetY;
1229
+ // 计算触摸位置与标记点的距离
1230
+ const distance = Math.sqrt(Math.pow(x - markerX, 2) + Math.pow(y - markerY, 2));
1231
+ if (distance < threshold && marker.id === markerObj.id) {
1232
+ const point = markerObj.getPosition(); // 获取marker标记点的位置
1233
+ markerObj.callout.addEventListener('open', function () {
1234
+ var _a, _b, _c, _d;
1235
+ const infoWindowElement = document.querySelector('.BMap_bubble_pop');
1236
+ if (infoWindowElement) {
1237
+ let triangle = infoWindowElement.querySelector('.triangle');
1238
+ if (!triangle) {
1239
+ // 如果不存在,则创建并添加新的三角形 div
1240
+ triangle = document.createElement('div');
1241
+ triangle.className = 'triangle'; // 添加一个类名以便日后查找
1242
+ infoWindowElement.appendChild(triangle);
1243
+ }
1244
+ const img = document.querySelector('.BMap_bubble_pop>img');
1245
+ if (img) {
1246
+ img.setAttribute('style', `position: absolute;transform: translate(-50%, 0); top: ${point.lat - 100}px; left: ${point.lng - 20}px;display:none`);
1247
+ }
1248
+ const backgroundcolor = (_a = marker.callout) === null || _a === void 0 ? void 0 : _a.bgColor;
1249
+ let borderWidth = ((_b = marker.callout) === null || _b === void 0 ? void 0 : _b.borderWidth) || 5;
1250
+ const borderColor = (_c = marker.callout) === null || _c === void 0 ? void 0 : _c.borderColor;
1251
+ const borderRadius = (_d = marker.callout) === null || _d === void 0 ? void 0 : _d.borderRadius;
1252
+ // 确保边框大小不超过15
1253
+ borderWidth = Math.min(borderWidth, 15);
1254
+ 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`);
1255
+ 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; `);
1256
+ }
1257
+ });
1258
+ // 最近的标记点距离小于阈值,表示用户点击到了标记点
1259
+ this.map.openInfoWindow(markerObj.callout, pt);
1260
+ }
1261
+ else {
1262
+ markerObj.callout.enableCloseOnClick();
1263
+ // 用户点击到了地图上的其他位置,不是标记点
1264
+ }
1265
+ });
1266
+ });
1267
+ }
1268
+ }
1269
+ // 判断是否有label属性
1270
+ if (marker.label) {
1271
+ const labelContent = marker.label.content || '';
1272
+ const labelOpts = {
1273
+ position: pt,
1274
+ offset: new BMapGL.Size(marker.label.anchorX || 0, marker.label.anchorY || 0),
1275
+ };
1276
+ const label = new BMapGL.Label(labelContent, labelOpts);
1277
+ const borderColor = marker.label.borderColor ? marker.label.borderColor : 'white';
1278
+ // 设置标签样式
1279
+ label.setStyle({
1280
+ color: marker.label.color,
1281
+ fontSize: marker.label.fontSize + 'px',
1282
+ borderWidth: marker.label.borderWidth + 'px',
1283
+ borderColor: borderColor,
1284
+ borderRadius: marker.label.borderRadius + 'px',
1285
+ background: marker.label.bgColor,
1286
+ padding: marker.label.padding + 'px',
1287
+ });
1288
+ markerObj.setLabel(label);
1289
+ }
1290
+ this.map.addOverlay(markerObj);
1291
+ }
1292
+ else {
1293
+ console.error('请检查marker经纬度和marker自定义图标路径和id值');
1294
+ }
1295
+ });
1296
+ }
1297
+ loadMapScript() {
1298
+ return new Promise((resolve, reject) => {
1299
+ const script = document.createElement('script');
1300
+ script.src = 'https://api.map.baidu.com/getscript?v=3.0&type=webgl&ak=Mb1FLBD3gfnY6bup4v6zEWh6MXwsZ9eo';
1301
+ script.defer = true;
1302
+ script.onload = () => resolve();
1303
+ script.onerror = reject;
1304
+ script.type = 'text/javascript';
1305
+ document.head.appendChild(script);
1306
+ });
8
1307
  }
9
- componentDidLoad() {
10
- notSupport('Map', this);
1308
+ async LoadBmapLibScript() {
1309
+ return new Promise((resolve, reject) => {
1310
+ // 地图加载完成后再加载BMapGLLib
1311
+ const bmapLibScript = document.createElement('script');
1312
+ bmapLibScript.src = '//mapopen.bj.bcebos.com/github/BMapGLLib/AreaRestriction/src/AreaRestriction.min.js';
1313
+ bmapLibScript.defer = true;
1314
+ bmapLibScript.type = 'text/javascript';
1315
+ bmapLibScript.onload = () => {
1316
+ resolve();
1317
+ };
1318
+ bmapLibScript.onerror = reject;
1319
+ document.head.appendChild(bmapLibScript);
1320
+ });
11
1321
  }
12
1322
  render() {
13
- return (h(Host, null));
1323
+ return (h(Host, null, h("div", { id: "mapContainer", ref: (dom) => {
1324
+ if (dom) {
1325
+ this.mapRef = dom;
1326
+ }
1327
+ }, style: { width: this.width, height: this.height } })));
14
1328
  }
15
- }, [0, "taro-map-core"]);
1329
+ get el() { return this; }
1330
+ static get style() { return mapCss; }
1331
+ }, [0, "taro-map-core", {
1332
+ "latitude": [2],
1333
+ "longitude": [2],
1334
+ "scale": [2],
1335
+ "minScale": [2, "min-scale"],
1336
+ "maxScale": [2, "max-scale"],
1337
+ "markers": [16],
1338
+ "polyline": [16],
1339
+ "circles": [16],
1340
+ "polygons": [16],
1341
+ "subkey": [1],
1342
+ "layerStyle": [2, "layer-style"],
1343
+ "rotate": [2],
1344
+ "skew": [2],
1345
+ "showCompass": [4, "show-compass"],
1346
+ "showScale": [4, "show-scale"],
1347
+ "enableOverlooking": [4, "enable-overlooking"],
1348
+ "enableZoom": [4, "enable-zoom"],
1349
+ "enableScroll": [4, "enable-scroll"],
1350
+ "enableRotate": [4, "enable-rotate"],
1351
+ "enableSatellite": [4, "enable-satellite"],
1352
+ "enableTraffic": [4, "enable-traffic"],
1353
+ "enableBuilding": [4, "enable-building"],
1354
+ "enableAutoMaxOverlooking": [4, "enable-auto-max-overlooking"],
1355
+ "enable3D": [4, "enable-3-d"],
1356
+ "width": [1],
1357
+ "height": [1]
1358
+ }]);
16
1359
  function defineCustomElement$1() {
17
1360
  if (typeof customElements === "undefined") {
18
1361
  return;