From 6c75df824742c446e8230391bac7dc356817fd39 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 29 Dec 2021 14:34:18 +0800
Subject: [PATCH] +适应2.5d 2d图层
---
src/components/mobileCortrol/index.vue | 60 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/src/components/mobileCortrol/index.vue b/src/components/mobileCortrol/index.vue
index 82a5c80..f4236f4 100644
--- a/src/components/mobileCortrol/index.vue
+++ b/src/components/mobileCortrol/index.vue
@@ -3,6 +3,20 @@
<div class="m-l-inbut zoom-in" @click="zoomIn">
<i class="el-icon-refresh"></i>
</div>
+ <div
+ class="m-l-inbut zoom-in m-l-inbut-2d"
+ :class="{ active: dimension == '2D' }"
+ @click="zoomIn('2D')"
+ >
+ 2D
+ </div>
+ <div
+ class="m-l-inbut zoom-in m-l-inbut-3d"
+ :class="{ active: dimension == '2.5D' }"
+ @click="zoomIn('2.5D')"
+ >
+ 2.5
+ </div>
</div>
</template>
@@ -16,23 +30,28 @@
};
},
computed: {
- ...mapGetters(["mviewer"]),
+ ...mapGetters(["mviewer", "startPointFn", "dimension"]),
},
created() {
this.DC = global.DC;
},
methods: {
zoomIn(val) {
- this.$store.dispatch("mapFlyTo", {
- //飞入
- lntLat: [115.87988885, 28.72502592, 2100],
- // lntLat: [115.87186406, 28.74449337, 1200],
- // lntLat: [121.50492752204283, 31.21567802276832, 2530],
- heading: 0,
- pitch: -45,
- roll: 0,
- noOpen: true,
- });
+ // this.$store.dispatch("mapFlyTo", {
+ // //飞入
+ // lntLat: [115.87988885, 28.72502592, 2100],
+ // // lntLat: [115.87186406, 28.74449337, 1200],
+ // // lntLat: [121.50492752204283, 31.21567802276832, 2530],
+ // heading: 0,
+ // pitch: -45,
+ // roll: 0,
+ // noOpen: true,
+ // });
+ if (val) {
+ this.$store.dispatch("MSET_DIMENSIONS", val);
+ return;
+ }
+ this.startPointFn();
},
},
};
@@ -48,6 +67,8 @@
width: 35px;
height: 35px;
background-color: rgb(33, 150, 243);
+ // stroke-width: 10;
+ // stroke: #fff;
display: flex;
align-items: center;
justify-content: center;
@@ -56,5 +77,22 @@
margin-bottom: 12px;
border-radius: 5px;
}
+ .m-l-inbut-2d {
+ position: relative;
+ top: 60px;
+ font-size: 16px;
+ &:hover {
+ background-color: rgb(21, 136, 230);
+ box-shadow: -2px -2px 3px rgb(3, 74, 136) inset;
+ }
+ }
+ .m-l-inbut-3d {
+ @extend .m-l-inbut-2d;
+ top: 55px;
+ }
+ .active {
+ background-color: rgb(72, 157, 226);
+ box-shadow: -2px -2px 3px rgb(16, 93, 161) inset;
+ }
}
</style>
--
Gitblit v1.9.3