forked from drone/command-center-dashboard

罗广辉
2025-04-09 ddd6bd55557b059cb78d820be03cf8149cba68c5
feat: 返回当前定位
2 files modified
14 ■■■■ changed files
src/views/Home/RSide.vue 8 ●●●●● patch | view | raw | blame | history
src/views/Home/useMapAggregation/useMapAggregation.js 6 ●●●● patch | view | raw | blame | history
src/views/Home/RSide.vue
@@ -41,14 +41,22 @@
import lc1 from '@/assets/images/rSide/lc1.png'
import tc from '@/assets/images/rSide/tc.png'
import tc1 from '@/assets/images/rSide/tc1.png'
import cesiumOperation from '@/utils/cesium-tsa'
let logIndex = ref(3);
const enterHover = (value) => {
    logIndex.value = value;
}
const { flyTo } = cesiumOperation()
const store = useStore();
const currentAreaPosition = computed(() => store.state.home.currentAreaPosition);
let activeIndex = ref(null);
const activeChange = (value) => {
    if(value === 0) {
        flyTo(currentAreaPosition.value, 0, currentAreaPosition.value.height)
    }
    if (value === 1){
        activeIndex.value = activeIndex.value === 1 ? null : value;
    }
src/views/Home/useMapAggregation/useMapAggregation.js
@@ -208,12 +208,12 @@
    const outlineGJson = await getOutLine(jsonPathPre, hierarchy)
    scalingJudgment.forEach(item => item.show && (item.outline = outlineGJson))
    const [longitude, latitude] = outlineGJson.features[0].properties.centroid
    setCenterPosition({longitude, latitude})
    flyTo({ longitude, latitude }, 0, scalingJudgment[(hierarchy.length - 3) * (-1)].height)
    const height = scalingJudgment[(hierarchy.length - 3) * (-1)].height
    setCenterPosition({longitude, latitude,height})
    flyTo({ longitude, latitude }, 0, height)
  }
  const userAreaPosition = computed(() => store.state.home.userAreaPosition);
  const currentAreaPosition = computed(() => store.state.home.currentAreaPosition);
  const setCenterPosition = (position) => {
    store.commit('setCurrentAreaPosition', position)