From 266bf7454bcd0e3d814c974c6b0b05349fe549db Mon Sep 17 00:00:00 2001
From: yxl <584911253@qq.com>
Date: 星期二, 14 一月 2025 17:16:11 +0800
Subject: [PATCH] commit

---
 src/assets/js/mapSetFunc.js |  180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 177 insertions(+), 3 deletions(-)

diff --git a/src/assets/js/mapSetFunc.js b/src/assets/js/mapSetFunc.js
index f3d9807..7b8c046 100644
--- a/src/assets/js/mapSetFunc.js
+++ b/src/assets/js/mapSetFunc.js
@@ -13,11 +13,20 @@
       case "aroundPoi":
         this.creatAroundPoi(res);
         break;
+      case "getStrike":
+        this.creatAroundPoi(res);
+        break;
       case "queryRelationship":
         this.creatQueryRelationship(res);
         break;
       case "queryMeta":
         this.creatQueryMeta(res);
+        break;
+      case "aroundPoi_2":
+        this.addWfsLayer(res);
+        break;
+      case "getParam":
+        this.addTetrahedron(res);
         break;
     }
   },
@@ -37,7 +46,7 @@
     this.setModelChangeColor(colors);
   },
   setModelChangeColor(res) {
-    console.log('mapServer.listData',mapServer.listData,config.modelLayer);
+    console.log('mapServer.listData', mapServer.listData, config.modelLayer);
     const modelLayer = mapServer.listData.filter((obj) => {
       if (obj.name == config.modelLayer) {
         return obj;
@@ -156,7 +165,7 @@
   },
 
   creatPoiMap(res) {
-    res.data.forEach((poi,index) => {
+    res.data.forEach((poi, index) => {
       // const poi = res.data[0];
       console.log('poi------', poi)
       const label = earthCtrl.factory.createLabel({
@@ -236,7 +245,7 @@
         ids: element.list
       });
     })
-    console.log('colors----',colors);
+    console.log('colors----', colors);
     store.state.setListColor = colors;
     store.state.showLenged = true;
     this.setModelChangeColor(colors);
@@ -323,6 +332,150 @@
       }
     });
   },
+
+  // 娣诲姞wfs
+  addWfsLayer(res) {
+    if (window.terrain) {
+      window.terrain.removeFromMap();
+      window.terrain = null;
+    }
+    // earthCtrl.viewer.scene.globe.show = false;
+    earthCtrl.viewer.camera.flyTo({
+      destination: {
+        x: -3475710.5684351875,
+        y: 5625834.799523204,
+        z: 2729961.751894543,
+      },
+      orientation: {
+        heading: 5.73978482494632,
+        pitch: -1.2817819264676036,
+        roll: 6.282989918773924,
+      },
+    });
+    const layer1 = earthCtrl.factory.createWfsLayer('point', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarSpot',
+      text: '[JiaShanBase:Type]',
+      color: '#de3',
+      disableDepthTestDistance: Infinity
+    })
+    this.layerList.push({
+      layer: layer1,
+      func: res.func
+    });
+    const layer2 = earthCtrl.factory.createWfsLayer('polyline', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarL',
+      width: 1.5,
+      color: '#87CEFA',
+      disableDepthTestDistance: Number.POSITIVE_INFINITY,
+    })
+    this.layerList.push({
+      layer: layer2,
+      func: res.func
+    });
+    const layer3 = earthCtrl.factory.createWfsLayer('polyline', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarM',
+      width: 1.5,
+      color: '#de3',
+      disableDepthTestDistance: Number.POSITIVE_INFINITY,
+    })
+    this.layerList.push({
+      layer: layer3,
+      func: res.func
+    });
+    const layer4 = earthCtrl.factory.createWfsLayer('polyline', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarS',
+      width: 1.5,
+      color: '#FF0000',
+      disableDepthTestDistance: Number.POSITIVE_INFINITY,
+    })
+    this.layerList.push({
+      layer: layer4,
+      func: res.func
+    });
+    this.addRaderLayer(res);
+  },
+  //闆疯揪閬僵鎵弿
+  addRaderLayer(res) {
+    //闆疯揪閬僵鎵弿锛堣嚜瀹氫箟锛�
+    const option = {
+      radius: 150000,  //鍗婂緞
+      yaw: 0,  //闆疯揪鏂瑰悜锛堝彲閫夛級
+      angle: 120,  //闆疯揪澶硅锛堝彲閫夛級
+      scanAngle: 30,  //鎵弿澶硅锛堝彲閫夛級
+      speed: 5,  //鍊嶉�燂紙鍙�夛級
+      maxLat: 90,  //涓嬬淮搴︼紙鍙�夛級
+      minLat: 45,  //涓婄淮搴︼紙鍙�夛級
+      stackPartitions: 40,  //妯悜缃戞牸鏁帮紙鍙�夛級
+      slicePartitions: 80,  //绾靛悜缃戞牸鏁帮紙鍙�夛級
+      //color: 'rgba(255,255,255,0.5)',  //闆疯揪閬僵棰滆壊锛堝彲閫夛級
+      //outlineColor: 'rgba(255,255,255,0.5)',  //闆疯揪閬僵杈规绾块鑹诧紙鍙�夛級
+      //scanColor: 'rgba(255,0,0,0.5)',   //鎵弿棰滆壊锛堝彲閫夛級
+    };
+    const position1 = [121.614202387521061, 23.990136825668284, 0];
+    // 闆疯揪閬僵
+    const layer = earthCtrl.factory.createRadarMaskScan('闆疯揪閬僵鎵弿1', position1, option)
+    this.layerList.push({
+      layer: layer,
+      func: 'radarMaskScan'
+    });
+  },
+  //瑙嗛敟
+  addTetrahedron(res) {
+    const modelLayer = mapServer.listData.filter((obj) => {
+      if (obj.name == config.modelLayer) {
+        return obj;
+      }
+    });
+    let ids = [];
+    res.data.forEach((item, index) => {
+      const tetrahedron = earthCtrl.factory.addTetrahedron({
+        position: {
+          lon: item.lontitude,
+          lat: item.lattitude,
+          height: item.height
+        },
+        multiple: 0.05,
+        scale: new SmartEarth.Cesium.Cartesian3(30, 30, 30),
+        color: "#FF0000",
+        outlineColor: "#FF0000"
+      });
+      if (index == 0) {
+        // 灏嗙粡绾害杞崲涓篊artesian3鍧愭爣
+        const position = Cesium.Cartesian3.fromDegrees(item.lontitude, item.lattitude - 0.01, 500);
+        // 鍒涘缓涓�涓竟鐣岀悆 (Bounding Sphere)锛屽亣璁惧崐寰勪负500
+        const boundingSphere = new Cesium.BoundingSphere(position, 1000);
+        // 浣跨敤 flyToBoundingSphere 瀹氫綅鐩告満
+        earthCtrl.viewer.camera.flyToBoundingSphere(boundingSphere, {
+          duration: 3.0,  // 椋炶鐨勬椂闂�
+          offset: new Cesium.HeadingPitchRange(0, Cesium.Math.toRadians(-30), 6.28316028073749),
+        });
+        // earthCtrl.camera.flyTo(item.lontitude, item.lattitude, 5000, 0, -90, 0, 2);
+      }
+      ids.push(item.uuid);
+      this.layerList.push({
+        layer: tetrahedron,
+        func: 'tetrahedron'
+      });
+    });
+    modelLayer[0].layer.style = new Cesium.Cesium3DTileStyle({
+      color: {
+        evaluateColor: (feature) => {
+          const id = feature.getProperty("id");
+          if (ids.indexOf(id) > -1) {
+            console.log("id**********", id);
+            return new SmartEarth.Cesium.Color.fromCssColorString(
+              '#FF0000'
+            );
+          }
+        }
+      }
+    });
+  },
+
   removeAll() {
     store.state.setListColor = [];
     store.state.showLenged = false;
@@ -360,6 +513,27 @@
         this.layerList.splice(i, 1);
         i--;
       }
+      else if (obj.func == "aroundPoi_2") {
+        this.layerList[i].layer.destroy();
+        this.layerList.splice(i, 1);
+        i--;
+      }
+      else if (obj.func == "radarMaskScan") {
+        this.layerList[i].layer.deleteObject();
+        this.layerList.splice(i, 1);
+        i--;
+      }
+      else if (obj.func == "tetrahedron") {
+        this.layerList[i].layer.deleteObject();
+        this.layerList.splice(i, 1);
+        i--;
+      }
+    }
+    if (!window.terrain) {
+      window.terrain = earthCtrl.factory.createTerrainLayer({
+        sourceType: "ctb",
+        url: config.terrainUrl
+      });
     }
   }
 };

--
Gitblit v1.9.3