|
|
@@ -36,7 +36,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang='ts'>
|
|
|
-import { onMounted, ref, watch } from 'vue'
|
|
|
+import {
|
|
|
+ onMounted, onUnmounted, ref, watch
|
|
|
+} from 'vue'
|
|
|
import useStore from '@/pages/store/index'
|
|
|
import MapService from './map.service'
|
|
|
|
|
|
@@ -90,6 +92,8 @@ watch(() => store.socektData, (v) => {
|
|
|
const es = el.inboundAndOutboundStations[j]
|
|
|
if (marks[props.Item.key][1][es.vehicleId]) {
|
|
|
// 更新位置
|
|
|
+ console.log(123, marks[props.Item.key][1][es.vehicleId])
|
|
|
+
|
|
|
marks[props.Item.key][1][es.vehicleId].markMap.setPosition([ es.lng, es.lat ])
|
|
|
marks[props.Item.key][1][es.vehicleId].markMap.show()
|
|
|
} else {
|
|
|
@@ -119,6 +123,7 @@ watch(() => props.Item.key, (v) => {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+onUnmounted(() => mapService.destory())
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|