From 93a38ac31615b1aa053a4440c59814ea72353945 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期二, 17 一月 2023 14:39:19 +0800
Subject: [PATCH] 界面修改

---
 src/views/Thematic/index.vue |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/views/Thematic/index.vue b/src/views/Thematic/index.vue
index dda0330..79b2813 100644
--- a/src/views/Thematic/index.vue
+++ b/src/views/Thematic/index.vue
@@ -415,6 +415,7 @@
       } else if (vid.indexOf('c') != -1) {
         var url = geoserverWFSLine + '%27' + res.name + '%27';
         axios.get(url).then((res) => {
+
           if (res.status == 200) {
             if (res.data.features.length == 0) return;
             var std = [];
@@ -422,15 +423,31 @@
               var featurLayer = res.data.features[i];
               var path = featurLayer.geometry.coordinates[0];
               for (var j in path) {
-                std.push(path[j][0], path[j][1], 50);
+                // std.push(path[j][0], path[j][1], 50);
+                std.push(path[j])
               }
             }
 
-            this.showPathLine(std);
+            var str = this.removeRepeat1(std);
+            var val = [];
+            for (var i in str) {
+              val.push(str[i][0], str[i][1], 50);
+            }
+            this.showPathLine(val)
           }
         });
       }
     },
+    removeRepeat1(arr) {
+      const obj = {};
+      return arr.filter(item => {
+        if (!obj[item.toString()]) {
+          obj[item.toString()] = item.toString();
+          return item;
+        }
+      });
+    },
+
     showPathLine(res) {
 
       window.sgworld.Creator.getFlyData(res, (data) => {
@@ -580,7 +597,7 @@
     setAddImageLayer(res) {
       let layerWMS = new Cesium.WebMapServiceImageryProvider({
         url: geoServerURl,
-        layers:res.resource,
+        layers: res.resource,
         parameters: {
           transparent: true,
           format: 'image/png',

--
Gitblit v1.9.3