From 81f54040c2cb65537c6c6e1db8358a39a57dea0d Mon Sep 17 00:00:00 2001
From: mayisheng <admin>
Date: Mon, 15 Aug 2022 16:14:01 +0800
Subject: [PATCH] 1

---
 src/components/mobileCortrol/index.vue |  169 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 98 insertions(+), 71 deletions(-)

diff --git a/src/components/mobileCortrol/index.vue b/src/components/mobileCortrol/index.vue
index 689f8dc..739a49e 100644
--- a/src/components/mobileCortrol/index.vue
+++ b/src/components/mobileCortrol/index.vue
@@ -1,82 +1,109 @@
 <template>
-  <div class="m-left-control">
-    <div class="m-l-inbut" @click="zoomIn('+')">+</div>
-    <div class="m-l-inbut" @click="zoomIn('-')">-</div>
-  </div>
+    <div class="m-left-control">
+        <!-- 3d切换
+mobileCortrol
+        -->
+        <!-- <div
+      class="m-l-inbut zoom-in m-l-inbut-2d"
+      :class="{ active: dimension == '3D' }"
+      @click="zoomIn('3D')"
+    >
+      3&nbsp;&nbsp;维
+        </div>-->
+        <div
+            class="m-l-inbut zoom-in m-l-inbut-3d"
+            :class="{ active: dimension == '2.5D' }"
+            @click="zoomIn('2.5D')"
+        >3D</div>
+    </div>
 </template>
 
 <script>
-import { mapGetters } from "vuex";
+import { mapGetters } from 'vuex'
 export default {
-  name: "mobileCortrol",
-  computed: {
-    ...mapGetters(["mviewer"]),
-  },
-  methods: {
-    zoomIn(val) {
-      let camera = this.mviewer.camera;
-      // console.log(camera.moveStart());
-      // this.mviewer.getImageryLayerInfo().then((res) => {
-      //   console.log(res);
-      // });
-      var ellipsoid = this.mviewer.scene.globe.ellipsoid;
-      var cartesian3 = DC.Namespace.Cesium.cartesian3(
-        camera.position.x,
-        camera.position.y,
-        camera.position.z
-      );
-      // // var cartographic = ellipsoid.cartesianToCartographic(cartesian3);
-      // // var lat = Cesium.Math.toDegrees(cartograhphic.latitude);
-      // // var lng = Cesium.Math.toDegrees(cartograhpinc.longitude);
-      // // var alt = cartographic.height;
-      console.log(cartesian3);
-      // let position = camera.position;
-      // for (let k in position) {
-      //   if (k == "x" || k == "y" || k == "z") {
-      //     console.log(k, " : ", position[k]);
-      //   }
-      // }
-      // if (val == "+") {
-      //   camera.position.x -= 614.8521;
-      //   camera.position.y -= 1002.9298;
-      //   camera.position.z += 682.3683;
-      // } else if (val == "-") {
-      //   camera.position.x += 614.8521;
-      //   camera.position.y += 1002.9298;
-      //   camera.position.z -= 682.3683;
-      // }
-      // camera.flyTo({
-      //   destination: position,
-      //   orientation: {
-      //     heading: camera.heading,
-      //     pitch: camera.pitch,
-      //     roll: camera.roll,
-      //   },
-      //   duration: 0.5,
-      //   convert: false,
-      // });
+    name: 'mobileCortrol',
+    data () {
+        return {}
     },
-  },
-};
+    computed: {
+        ...mapGetters(['dimension'])
+    },
+    created () { },
+    methods: {
+        zoomIn (val) {
+            if (val) {
+                if (this.dimension != val) {
+                    this.$store.dispatch('MSET_DIMENSIONS', val)
+                }
+            }
+        }
+    }
+}
 </script>
 
-<style scoped lang='scss'>
+<style scoped lang="scss">
 .m-left-control {
-  position: fixed;
-  left: 20px;
-  top: 20px;
-  z-index: 200;
-  .m-l-inbut {
-    width: 32px;
-    height: 32px;
-    background-color: #c9302c;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    color: white;
-    font-size: 22px;
-    margin-bottom: 12px;
-    border-radius: 5px;
-  }
+    position: fixed;
+    left: 20px;
+    top: 93px;
+    height: 10px;
+    z-index: 20 !important;
+    .m-l-inbut {
+        width: 35px;
+        height: 35px;
+        background-color: rgb(33, 150, 243);
+        // background-color: white;
+        // stroke-width: 10;
+        // stroke: #fff;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        color: white;
+        font-size: 22px;
+        margin-bottom: 12px;
+        border-radius: 5px;
+    }
+    .m-l-inbut-2d {
+        position: relative;
+        background-color: white;
+        top: 60px;
+        font-size: 12px;
+        color: #000;
+        border: 1px solid #a4d1ff;
+        border-radius: 5px 5px 0 0;
+        // box-shadow: 0px 0px 10px #409eff inset;
+        // &: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: 45px;
+        border-radius: 0 0 5px 5px;
+    }
+
+    .active {
+        background-color: #409eff;
+        border: 1px solid #409eff;
+        color: #fff;
+        border-radius: 5px;
+        z-index: 10;
+        // box-shadow: -4px -4px 10px rgb(13, 98, 167) inset;
+        // color: rgb(0, 0, 0);
+        // box-shadow: -4px -4px 10px rgb(13, 98, 167) inset;
+        transform: translateY(1px);
+        // position: relative;
+        // &::before {
+        //   top: 1px;
+        //   left: 1px;
+        //   position: absolute;
+        //   content: "";
+        //   width: 100%;
+        //   height: 100%;
+        //   box-shadow: -2px -2px 15px rgb(4, 95, 170) inset;
+        //   // border: 1px solid rgb(14, 54, 87);
+        // }
+    }
 }
 </style>

--
Gitblit v1.9.3