From 9f51306b10520a2be30bedfe1b34c288cf770f43 Mon Sep 17 00:00:00 2001
From: surprise <15810472099@163.com>
Date: 星期四, 19 十月 2023 17:51:30 +0800
Subject: [PATCH] 坡度坡向功能新增,临时图层添加定位。空间查询功能优化;

---
 src/assets/js/Map/temporaryTools.js |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/assets/js/Map/temporaryTools.js b/src/assets/js/Map/temporaryTools.js
index f8be7c8..fdafaf3 100644
--- a/src/assets/js/Map/temporaryTools.js
+++ b/src/assets/js/Map/temporaryTools.js
@@ -10,6 +10,20 @@
             }
         }
     },
+    locationTemporaryLayer(res){
+        var entities = window.Viewer.entities._entities._array;
+        for (var i in entities) {
+            if (entities[i].id == res.id && entities[i]._shpType == res.shpType) {
+                window.Viewer.flyTo(entities[i], {
+                    offset: {
+                      heading: Cesium.Math.toRadians(0.0),
+                      pitch: Cesium.Math.toRadians(-90),
+                      range: 400
+                    }
+                  });
+            }
+        }
+    },
     addTemporaryTool(res) {
         switch (res.type) {
             case "point":
@@ -142,7 +156,7 @@
         if (res.outline) {
             outlinewidth = res.width
         }
- 
+
         window.Viewer.entities.add({
             name: res.cnName,
             id: res.id,
@@ -156,7 +170,7 @@
                     res.near,
                     res.far
                 ),
-  
+
                 material: new Cesium.PolylineOutlineMaterialProperty({
                     color: Cesium.Color.fromCssColorString(res.material).withAlpha(
                         res.materialAlpha
@@ -339,7 +353,7 @@
             layerType: '绾�',
             geometry: geom,
             heightReference: res.polyline.clampToGround._value,
-            outline:  res.outline != null ?  res.outline : false,
+            outline: res.outline != null ? res.outline : false,
             width: res.polyline.width._value,
             material: this.colorRgbToHex('rgb(' + (mataColor.red * 255) + ',' + (mataColor.green * 255) + ',' + (mataColor.blue * 255) + ')'),
             outlineColor: this.colorRgbToHex('rgb(' + (outlineColor.red * 255) + ',' + (outlineColor.green * 255) + ',' + (outlineColor.blue * 255) + ')'),
@@ -361,7 +375,6 @@
         if (res.label.outlineWidth && res.label.outlineWidth._value) {
             width = res.label.outlineWidth._value
         }
-
         return {
             id: this.isedit ? res.id : (new Date()).getTime(),
             cnName: res.name,
@@ -386,7 +399,6 @@
             layerType: '鏂囨湰鐐�',
         }
     },
-
     getPointEntityObj(res) {
         var mataColor = res.point.color._value;
         var outlineColor = res.point.outlineColor._value;

--
Gitblit v1.9.3