| | |
| | | console.log(arr) |
| | | console.log(this.treeData) |
| | | // this.treeData = arr |
| | | this.treeData = this.lastTableArr |
| | | // this.treeData = this.lastTableArr |
| | | this.treeData = arr.map((groundPoint, index) => { |
| | | // 查找对应的新地面点数据 |
| | | const newGroundPoint = this.treeData[index]; |
| | | if (newGroundPoint && newGroundPoint.children) { |
| | | // 更新每个地面点的子点经纬度 |
| | | groundPoint.children = groundPoint.children.map((child, childIndex) => { |
| | | const newChild = newGroundPoint.children[childIndex]; |
| | | if (newChild) { |
| | | return { |
| | | ...child, |
| | | longitude: newChild.longitude, |
| | | latitude: newChild.latitude, |
| | | height: newChild.height, |
| | | heading: newChild.heading, |
| | | pitch: newChild.pitch, |
| | | actions: newChild.actions |
| | | }; |
| | | } |
| | | return child; |
| | | }); |
| | | } |
| | | return groundPoint; |
| | | }); |
| | | const result = this.replaceCloseChildrenWithHighestPoint(this.treeData,mergeNumber); |
| | | // const updated = this.insertRaisedPoints(result, 0,0, 236, 130); |
| | | const updated = this.insertRaisedPoints(result, globalon, globalat, towerHeight); |
| | |
| | | console.log(this.treeData) |
| | | }, |
| | | //数组 塔的精度 塔的纬度 塔的高度 半径 |
| | | insertRaisedPoints(data, centerLon, centerLat, centerHeight, radius = 15) { |
| | | insertRaisedPoints(data, centerLon, centerLat, centerHeight, radius = 1) { |
| | | const center = Cesium.Cartesian3.fromDegrees(centerLon, centerLat, centerHeight); |
| | | const result = JSON.parse(JSON.stringify(data)); // 深拷贝避免污染原数据 |
| | | const inserts = []; // 用于存储插入项及其目标位置 |