Showing
1 changed file
with
9 additions
and
10 deletions
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | import { useBaiduMapSDK } from '../../../hook/useBaiduMapSDK'; | 14 | import { useBaiduMapSDK } from '../../../hook/useBaiduMapSDK'; |
15 | import { HistoryModalOkEmitParams, TrackAnimationStatus } from './type'; | 15 | import { HistoryModalOkEmitParams, TrackAnimationStatus } from './type'; |
16 | import { useMapTrackPlayback } from './useMapTrackPlayback'; | 16 | import { useMapTrackPlayback } from './useMapTrackPlayback'; |
17 | - import { shallowRef } from 'vue'; | 17 | + // import { shallowRef } from 'vue'; |
18 | import { formatToDateTime } from '/@/utils/dateUtil'; | 18 | import { formatToDateTime } from '/@/utils/dateUtil'; |
19 | 19 | ||
20 | const props = defineProps<{ | 20 | const props = defineProps<{ |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | 25 | ||
26 | const wrapId = `bai-map-${buildUUID()}`; | 26 | const wrapId = `bai-map-${buildUUID()}`; |
27 | 27 | ||
28 | - const mapInstance = shallowRef<Nullable<Recordable>>(null); | 28 | + const mapInstance = ref<Nullable<Recordable>>(null); |
29 | 29 | ||
30 | const rangString = ref<Nullable<string>>(null); | 30 | const rangString = ref<Nullable<string>>(null); |
31 | 31 | ||
@@ -35,6 +35,9 @@ | @@ -35,6 +35,9 @@ | ||
35 | openModal(true, toRaw(props.config.option.dataSource)); | 35 | openModal(true, toRaw(props.config.option.dataSource)); |
36 | }; | 36 | }; |
37 | 37 | ||
38 | + const { genTrackPlaybackAnimation, playStatus, playFn, continueFn, pauseFn } = | ||
39 | + useMapTrackPlayback(mapInstance); | ||
40 | + | ||
38 | const getIsWidgetLibSelectMode = computed(() => { | 41 | const getIsWidgetLibSelectMode = computed(() => { |
39 | return !props.config.option.dataSource; | 42 | return !props.config.option.dataSource; |
40 | }); | 43 | }); |
@@ -68,8 +71,8 @@ | @@ -68,8 +71,8 @@ | ||
68 | async function initMap() { | 71 | async function initMap() { |
69 | const wrapEl = unref(wrapRef); | 72 | const wrapEl = unref(wrapRef); |
70 | if (!wrapEl) return; | 73 | if (!wrapEl) return; |
71 | - const BMapGL = (window as any).BMapGL; | ||
72 | if (!Reflect.has(window, 'BMapGL')) return; | 74 | if (!Reflect.has(window, 'BMapGL')) return; |
75 | + const BMapGL = (window as any).BMapGL; | ||
73 | mapInstance.value = new BMapGL.Map(wrapId); | 76 | mapInstance.value = new BMapGL.Map(wrapId); |
74 | 77 | ||
75 | // 定位当前城市 | 78 | // 定位当前城市 |
@@ -89,13 +92,10 @@ | @@ -89,13 +92,10 @@ | ||
89 | } | 92 | } |
90 | 93 | ||
91 | const { loading } = useBaiduMapSDK(initMap); | 94 | const { loading } = useBaiduMapSDK(initMap); |
92 | - | ||
93 | - const { genTrackPlaybackAnimation, playStatus, playFn, continueFn, pauseFn } = | ||
94 | - useMapTrackPlayback(mapInstance); | ||
95 | </script> | 95 | </script> |
96 | 96 | ||
97 | <template> | 97 | <template> |
98 | - <main class="w-full h-full flex flex-col justify-center items-center"> | 98 | + <main class="w-full h-full flex flex-col p-2 justify-center items-center"> |
99 | <div class="w-full flex justify-end"> | 99 | <div class="w-full flex justify-end"> |
100 | <Button | 100 | <Button |
101 | type="text" | 101 | type="text" |
@@ -126,9 +126,8 @@ | @@ -126,9 +126,8 @@ | ||
126 | :spinning="loading" | 126 | :spinning="loading" |
127 | wrapper-class-name="map-spin-wrapper !w-full !h-full !flex justify-center items-center pointer-events-none" | 127 | wrapper-class-name="map-spin-wrapper !w-full !h-full !flex justify-center items-center pointer-events-none" |
128 | tip="地图加载中..." | 128 | tip="地图加载中..." |
129 | - > | ||
130 | - <div ref="wrapRef" :id="wrapId" class="w-full h-full no-drag"> </div> | ||
131 | - </Spin> | 129 | + /> |
130 | + <div ref="wrapRef" :id="wrapId" class="w-full h-full no-drag"> </div> | ||
132 | 131 | ||
133 | <HistoryDataModel @register="register" @ok="handleRenderHistroyData" /> | 132 | <HistoryDataModel @register="register" @ok="handleRenderHistroyData" /> |
134 | </main> | 133 | </main> |