From 5df6240f6cd274e698d1e6358443364d543c126c Mon Sep 17 00:00:00 2001
From: Jin Lei <jinlei_182@163.com>
Date: 星期六, 23 十二月 2023 10:23:27 +0800
Subject: [PATCH] [信令]添加信令相关功能

---
 src/components/map/viewer.vue |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/components/map/viewer.vue b/src/components/map/viewer.vue
index 33d48fa..1a7c8e9 100644
--- a/src/components/map/viewer.vue
+++ b/src/components/map/viewer.vue
@@ -2,7 +2,7 @@
   <div>
     <div id="sdkContainer"></div>
     <div class="listBox" v-show="viewer1Show && !isLand">
-      <ul>
+      <ul id="viewer_lsyx">
         <li
           v-for="(item, index) in arr"
           :key="index"
@@ -101,11 +101,17 @@
     viewer1Show(newvalue, oldvalue) {
       if (!newvalue) {
         this.destroyImageLayer();
+      } else {
+        if (!this.isLand) {
+          this.initLSYX();
+        }
       }
     },
     isLand(newvalue, oldvalue) {
       if (newvalue) {
         this.destroyImageLayer();
+      } else {
+        this.initLSYX();
       }
     },
   },
@@ -118,6 +124,7 @@
         {
           StaticFileBaseUrl: "../../../static/CimSDK/",
           // StaticFileBaseUrl: "../../../SW/static/CimSDK/",
+          // StaticFileBaseUrl: "../../../YZXNCS/static/CimSDK/",
         },
         {},
         {},
@@ -162,8 +169,9 @@
         }
       );
       window.Viewer = sgworld._Viewer;
-      
-      window.sgwfs = new SmartEarth.WFSTool(sgworld._Viewer,Cesium);
+      window.viewer = sgworld._Viewer;
+      sgworld._Viewer.scene.moon.show = false;
+      window.sgwfs = new SmartEarth.WFSTool(sgworld._Viewer, Cesium);
       Viewer.shadows = false;
       //娣卞害妫�娴�
       sgworld.Analysis.depthTestAgainstTerrain(true);
@@ -279,6 +287,11 @@
         this.destroyImageLayer();
       }
     },
+    initLSYX() {
+      let ul = document.getElementById("viewer_lsyx");
+      let lis = ul.getElementsByTagName("li");
+      lis[19].click();
+    },
     destroyImageLayer() {
       if (activeLi) {
         activeLi.classList.remove("active");
@@ -309,7 +322,10 @@
         nLayer = null;
       }
       nLayer = this.loadBJ54ImageLayer(year);
-      if (!LWLayer) {
+      if (!LWLayer || Viewer.imageryLayers.indexOf(LWLayer) < 0) {
+        if (LWLayer) {
+          LWLayer.destroy();
+        }
         LWLayer = this.loadBJ54LWLayer();
       }
     },
@@ -459,6 +475,11 @@
           cancel: function () {
             if (cancelFn && typeof cancelFn === "function") {
               cancelFn();
+              if (window.pickFeature && window.pickFeature.primitive) {
+                window.pickFeature.primitive.image = imgUrl;
+                window.pickFeature.primitive.scale = scale;
+                window.pickFeature = null;
+              }
             }
           },
           end: function () {

--
Gitblit v1.9.3