From c0ff61d066a9f65aa0cdbeb1e10a249763f1e966 Mon Sep 17 00:00:00 2001
From: yxl <584911253@qq.com>
Date: 星期四, 02 一月 2025 09:58:41 +0800
Subject: [PATCH] 最新代码提交

---
 src/assets/js/map/mapView.js |  107 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 102 insertions(+), 5 deletions(-)

diff --git a/src/assets/js/map/mapView.js b/src/assets/js/map/mapView.js
index 21816c0..4bdab51 100644
--- a/src/assets/js/map/mapView.js
+++ b/src/assets/js/map/mapView.js
@@ -16,7 +16,7 @@
       // 闅愯棌榛樿搴曞浘
       defaultImagery: false,
       // 闅愯棌logo
-      printLog: false
+      printLog: false,
       // maxViewHeight: 1200000
       // sceneMode: SmartEarth.Cesium.SceneMode.SCENE2D
     });
@@ -31,7 +31,7 @@
         // 杩欓噷鍙互鑾峰彇鍒扮偣鍑荤殑瀹炰綋鎴栧叾浠栧璞�
         var featureId = pickedObject.getProperty("id");
         console.log(featureId);
-        
+
         // pickedObject.color = Cesium.Color.RED;
         console.log("鐐瑰嚮鐨勫璞�:", pickedObject);
       }
@@ -66,9 +66,9 @@
       0.001313831409284339,
       2
     );
-// setTimeout(() => {
-//   mapModel.init();
-// }, 5000);
+    // setTimeout(() => {
+    //   mapModel.init();
+    // }, 5000);
     // mapServer.addServer({
     //   sourceType: "Tileset",
     //   url: "http://103.135.160.14:9038/gisserver/c3dserver/JiashanBase/tileset.json",
@@ -108,6 +108,14 @@
     //   }
     // });
     // mapInfo.setEntityQueryInput();
+    // this.addWfsLayer()
+    // this.addRaderLayer()
+    // this.addModel()
+    // this.addTetrahedron({
+    //   lon: 121.614202387521061,
+    //   lat: 23.990136825668284,
+    //   alt: 150
+    // })
   },
   addTetrahedron(res) {
     earthCtrl.factory.addTetrahedron({
@@ -213,6 +221,95 @@
       url: "https://rt0.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=4&scene=0",
       tilingScheme: earthCtrl.core.getOffsetTilingScheme() // 鍋忕Щ绾犳
     });
+  },
+
+  // 娣诲姞wfs
+  addWfsLayer() {
+    earthCtrl.viewer.camera.flyTo({
+      destination: {
+        x: -3475710.5684351875,
+        y: 5625834.799523204,
+        z: 2729961.751894543,
+      },
+      orientation: {
+        heading: 5.73978482494632,
+        pitch: -1.2817819264676036,
+        roll: 6.282989918773924,
+      },
+    });
+    earthCtrl.factory.createWfsLayer('point', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarSpot',
+      text: '[JiaShanBase:Type]',
+      color: '#de3',
+      disableDepthTestDistance: Infinity
+    })
+    earthCtrl.factory.createWfsLayer('polyline', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarL',
+      width: 1.5,
+      color: '#87CEFA',
+    })
+    earthCtrl.factory.createWfsLayer('polyline', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarM',
+      width: 1.5,
+      color: '#de3',
+    })
+
+    earthCtrl.factory.createWfsLayer('polyline', {
+      urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows',
+      layer: 'JiaShanBase:RadarS',
+      width: 1.5,
+      color: '#FF0000',
+    })
+  },
+  addRaderLayer() {
+    //闆疯揪閬僵鎵弿锛堣嚜瀹氫箟锛�
+    const option = {
+      radius: 1000,  //鍗婂緞
+      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];
+    // 闆疯揪閬僵
+    earthCtrl.factory.createRadarMaskScan('闆疯揪閬僵鎵弿1', position1, option)
+  },
+  addModel() {
+    const entity = earthCtrl.viewer.entities.add({
+      position: SmartEarth.Cesium.Cartesian3.fromDegrees(
+        121.614202387521061,
+        23.990136825668284,
+        0
+      ),
+      model: {
+        uri: '/gltf/tank.glb',
+        scale: 15,
+        heightReference: SmartEarth.Cesium.HeightReference.CLAMP_TO_GROUND,
+        disableDepthTestDistance: Number.POSITIVE_INFINITY // 绂佺敤娣卞害娴嬭瘯
+      },
+      label: {
+        show: true,
+        text: '缁忓害锛�121.6142023,绾害锛�23.9901368',
+        color: SmartEarth.Cesium.Color.fromCssColorString("#fff"),
+        font: "normal 14px MicroSoft YaHei",
+        showBackground: true,
+        outlineColor: SmartEarth.Cesium.Color.WHITE,
+        pixelOffset: new SmartEarth.Cesium.Cartesian2(10, -30),
+        horizontalOrigin: SmartEarth.Cesium.HorizontalOrigin.CENTER,
+        verticalOrigin: SmartEarth.Cesium.VerticalOrigin.BOTTOM,
+        heightReference: SmartEarth.Cesium.HeightReference.CLAMP_TO_GROUND,
+      },
+    });
   }
 };
 export default mapViewer;

--
Gitblit v1.9.3