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