From 97277a2c41d80bbf375f88a47e242f1b17602b2b Mon Sep 17 00:00:00 2001
From: surprise <15810472099@163.com>
Date: 星期三, 29 十一月 2023 16:53:10 +0800
Subject: [PATCH] 发布管理修改

---
 src/components/MapDiv.vue |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/components/MapDiv.vue b/src/components/MapDiv.vue
index 9c1be5b..e55ced2 100644
--- a/src/components/MapDiv.vue
+++ b/src/components/MapDiv.vue
@@ -24,6 +24,7 @@
       <mapol></mapol>
     </div>
     <add-online-map ref="addOnlineMap" />
+    <add-online-ol-map ref="addOnlineOlMap"></add-online-ol-map>
   </div>
 </template>
 
@@ -35,13 +36,15 @@
 import ol from "ol"
 import $ from "jquery"
 import AddOnlineMap from '../views/Tools/AddOnlineMap.vue'
+import AddOnlineOlMap from '../views/Tools/AddOnlineOLMap.vue'
 export default {
   name: "",
 
   components: {
     mapsdk,
     mapol,
-    AddOnlineMap
+    AddOnlineMap,
+    AddOnlineOlMap
   },
   data() {
     return {
@@ -62,6 +65,7 @@
     changeMap(res) {
       this.isSplitFlag = res
       this.getMapViewCenter(this.isSplitFlag);
+  
       switch (res) {
         case 1:
           this.isShowCeMap = true
@@ -70,8 +74,9 @@
           this.isShowOlMap = true
           this.isSdkMapFlag = true
           var that = this
-
+          this.$store.state.setChangeBaseMap = false;
           setTimeout(function () {
+       
             window.map.updateSize()
             that.showSplitMap()
           }, 500)
@@ -96,6 +101,7 @@
           this.isOlMapFlag = false
           this.isShowCeMap = false
           var val = this.$store.state.Map3;
+          this.$store.state.setChangeBaseMap = true; 
           window.Viewer.camera.setView({
             destination: Cesium.Cartesian3.fromDegrees(val[0], val[1], val[2]),
           })
@@ -227,13 +233,22 @@
       }
       return this.levelArray[this.levelArray.length - 1]
     },
-    showBaseMapLayer() {
-      this.$refs && this.$refs.addOnlineMap && this.$refs.addOnlineMap.open("鍦ㄧ嚎鍦板浘", null);
-    }
+    showBaseMapLayer(res) {
+      this.closeAllBaseMapLayer();
+      if(res.type == 'ol'){
+        this.$refs && this.$refs.addOnlineOlMap && this.$refs.addOnlineOlMap.open("2D鍦ㄧ嚎鍦板浘", null);
+      }else{
+        this.$refs && this.$refs.addOnlineMap && this.$refs.addOnlineMap.open("3D鍦ㄧ嚎鍦板浘", null);
+      }
+    },
+    closeAllBaseMapLayer(){
+      this.$refs && this.$refs.addOnlineOlMap && this.$refs.addOnlineOlMap.close();
+      this.$refs && this.$refs.addOnlineMap && this.$refs.addOnlineMap.close();
+    },
   },
   mounted() {
     this.$bus.$on("setChangeBaseMapLayer", (res) => {
-      this.showBaseMapLayer()
+      this.showBaseMapLayer(res)
 
 
     })
@@ -269,7 +284,7 @@
   width: 100%;
 }
 .sdkMapTwo {
-  width: calc(50% - 1px);
+  width: calc(50% - 2px);
 }
 .olMap {
   height: 100%;
@@ -281,7 +296,7 @@
   width: 100%;
 }
 .olMapTwo {
-  width: calc(50% - 1px);
+  width: calc(50% - 2px);
 }
 #ds {
   height: 100%;

--
Gitblit v1.9.3