Procházet zdrojové kódy

调整疏浚前后对比图层控制 地图透明度;

sbj před 1 rokem
rodič
revize
d0f372509c
2 změnil soubory, kde provedl 26 přidání a 1 odebrání
  1. 13 1
      src/utils/map/Channel.js
  2. 13 0
      src/views/map/Index.vue

+ 13 - 1
src/utils/map/Channel.js

@@ -37,11 +37,23 @@ export function locationYjModel(id,isShow){
  * @param value
  * @param isShow
  */
+let sjdbList = ['2022LjzBefore','2022LjzAfter']
+let isShowSjdb = false
 export function compareSjBeforeAfter(value,isShow) {
     if(isShow){
         setOpacity(0.4)
+        sjdbList.forEach(item=>{
+            if(item != value){
+                addLayerByName(item,false,1);
+            }
+        })
     }else{
-        setOpacity(1)
+        if(value == null || value == ''){
+            sjdbList.forEach(item=>{
+                addLayerByName(item,false,1);
+            })
+            setOpacity(1)
+        }
     }
     switch(value){
         case '2022LjzBefore':

+ 13 - 0
src/views/map/Index.vue

@@ -28,6 +28,8 @@
             <button @click="test('航标')">航标</button>
             <button @click="test('水下地形')">水下地形</button>
             <button @click="test('淤积预警')">淤积预警</button>
+            <button @click="test('疏浚前')">疏浚前</button>
+            <button @click="test('疏浚后')">疏浚后</button>
             <button @click="test('白膜')">白膜</button>
             <button @click="test('关闭全部图层')">关闭全部图层</button>
             <button @click="test('基础地图')">基础地图</button>
@@ -49,6 +51,7 @@
     import {setBoat, setBoatPath, onLocationBoat, locationBoat, boatDriving, drawArea, setMultiBoatHistory, playAreaBoatHistory,djldBoatHistory} from '@/utils/map/Boat'
     import {setCenter, setVideoCamera} from '@/utils/map/Common'
     import {addDefaultServer,addLayerByName,closeAllLayer} from '@/utils/map/Layer'
+    import {compareSjBeforeAfter} from '@/utils/map/Channel'
 
     export default {
         name: "MapHome",
@@ -184,6 +187,16 @@
                     case '淤积预警':
                         this.isShowYjyjLayer = !this.isShowYjyjLayer
                         addLayerByName('yjyj',this.isShowYjyjLayer)
+                        break
+                    case '疏浚前':
+                        compareSjBeforeAfter('2022LjzAfter',false)
+                        compareSjBeforeAfter('2022LjzBefore',true)
+
+                        break
+                    case '疏浚后':
+                        compareSjBeforeAfter('2022LjzBefore',false)
+                        compareSjBeforeAfter('2022LjzAfter',true)
+
                         break
                     case '白膜':
                         this.isShowBmLayer = !this.isShowBmLayer