月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-06-06 b035823c711d43902a06838065598f4f805ab408
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<template>
  <div class="bottom_btn">
    <div
      v-show="mapFlag == '2D'"
      class="ChangeMap twoImg"
      @click="setMapImg('2D')"
    >
    </div>
    <div
      v-show="mapFlag != '2D'"
      class="ChangeMap threeImg"
      @click="setMapImg('3D')"
    >
    </div>
  </div>
</template>
 
<script lang="ts" setup>
import {
  ref,
  onMounted,
  onBeforeUnmount,
  reactive,
  defineProps,
  defineEmits,
} from "vue";
const mapFlag = ref("2D");
 
const setMapImg = (res) => {
  if (res == "2D") {
    mapFlag.value = "3D";
    earthCtrl.coreMap.scene.mode = SmartEarth.Cesium.SceneMode.SCENE2D;
  } else if (res == "3D") {
    mapFlag.value = "2D";
    earthCtrl.coreMap.scene.mode = SmartEarth.Cesium.SceneMode.SCENE3D;
  }
};
onMounted(() => {});
</script>
<style lang="less" scoped>
.bottom_btn {
  position: absolute;
  bottom: 68px;
  right: 70px;
 
  .ChangeMap {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .twoImg {
    background: url("../assets/img/2D.png") no-repeat;
  }
  .threeImg {
    background: url("../assets/img/3D.png") no-repeat;
  }
}
</style>