From f11f559192ca5fd9b8ca66197016a1ec7ead9729 Mon Sep 17 00:00:00 2001
From: BaoXs <bao_dida@163.com>
Date: 星期一, 16 五月 2022 10:55:47 +0800
Subject: [PATCH] Merge branch 'master' of http://117.78.1.188:8089/r/DDE-WEB
---
view/project/layerAnalysis.html | 64 +++++++++++++++++++++----------
1 files changed, 43 insertions(+), 21 deletions(-)
diff --git a/view/project/layerAnalysis.html b/view/project/layerAnalysis.html
index e73dad7..1df3ed5 100644
--- a/view/project/layerAnalysis.html
+++ b/view/project/layerAnalysis.html
@@ -56,9 +56,10 @@
border-radius: 6px;
background-color: #999;
}
- .layui-tree-btnGroup .layui-icon{
+
+ .layui-tree-btnGroup .layui-icon {
display: inline-block;
- color:white
+ color: white
}
</style>
@@ -68,10 +69,10 @@
layui.use(['tree'], function () {
var tree = layui.tree
isloading = true;
- var modelTree=tree.render({
+ var modelTree = tree.render({
elem: '#model-tree-list'
, data: layerMenu
- , edit:["del"]
+ , edit: ["del"]
, showCheckbox: true //鏄惁鏄剧ず澶嶉�夋
, id: 'model-tree-list'
, isJump: false //鏄惁鍏佽鐐瑰嚮鑺傜偣鏃跺脊鍑烘柊绐楀彛璺宠浆
@@ -91,7 +92,7 @@
var data = obj.data.ext; //鑾峰彇褰撳墠鐐瑰嚮鐨勮妭鐐规暟鎹�
var viewer = parent.viewer;
var Cesium = parent.Cesium;
- if (type != 'BaseMap' && type != 'Terrain' && type != 'Plotting') {
+ if (type != 'BaseMap' && type != 'Terrain' && type != 'Plotting' && type != 'DDE') {
var model = undefined;
switch (obj.data.field) {
case "Primitive": {
@@ -117,12 +118,12 @@
let shpArray = JSON.parse(path);
var shpPromises = [];
for (let i = 0; i < shpArray.length; i++) {
- shpPromises.push( Cesium.loadBlob(parent.httpConfig.nginxUrl + shpArray[i]));
- }
-
+ shpPromises.push(Cesium.loadBlob(parent.httpConfig.nginxUrl + shpArray[i]));
+ }
+
var layer = null;
parent.Cesium.when.all(shpPromises, function (files) {
- for(let i=0;i<shpArray.length;i++){
+ for (let i = 0; i < shpArray.length; i++) {
files[i].name = shpArray[i];
}
@@ -183,6 +184,24 @@
});
}
+ }
+ else if (type == 'DDE') {
+ var lon, lat, alt;
+ lon = obj.data.lon;
+ lat = obj.data.lat;
+ alt = obj.data.altitude;
+ console.log(lon, lat, alt);
+ if (lon != undefined && lat != undefined && alt != undefined) {
+ let flyPromise = viewer.camera.flyTo({
+ duration: 3,
+ destination: Cesium.Cartesian3.fromDegrees(Number(lon), Number(lat), alt),
+ orientation: {
+ heading: Cesium.Math.toRadians(0), //缁曞瀭鐩翠簬鍦板績鐨勮酱鏃嬭浆
+ pitch: Cesium.Math.toRadians(-90), //缁曠含搴︾嚎鏃嬭浆
+ roll: Cesium.Math.toRadians(0) //缁曠粡搴︾嚎鏃嬭浆
+ },
+ });
+ }
}
}
, oncheck: function (obj) {
@@ -319,17 +338,17 @@
}
}
//zzf:闅愯棌闄ょ粯鍥捐彍鍗曚互澶栫殑鍒犻櫎鎸夐挳
- $(modelTree.config.elem[0].children[0].childNodes).each(function(){
- let parentDiv=$(this)[0].childNodes[0];
- $(parentDiv).find("div .layui-icon-delete").remove();
- if($(this)[0].dataset.id!="4"){
- let childrenDiv=$(this)[0].childNodes[1];
- $(childrenDiv).find("div .layui-icon-delete").remove();
+ $(modelTree.config.elem[0].children[0].childNodes).each(function () {
+ let parentDiv = $(this)[0].childNodes[0];
+ $(parentDiv).find("div .layui-icon-delete").remove();
+ if ($(this)[0].dataset.id != "4") {
+ let childrenDiv = $(this)[0].childNodes[1];
+ $(childrenDiv).find("div .layui-icon-delete").remove();
}
})
- function delDrawEntity(modelId){
- let updateData= {
- "ids":modelId,
+ function delDrawEntity(modelId) {
+ let updateData = {
+ "ids": modelId,
}
let token = window.localStorage.getItem("token");
$.ajax({
@@ -338,8 +357,8 @@
url: parent.httpConfig.webApiUrl + "landstamp/front/removeDrawEntity",
data: updateData,
contentType: "application/x-www-form-urlencoded",
- beforeSend:function(request){
- request.setRequestHeader("token",token);
+ beforeSend: function (request) {
+ request.setRequestHeader("token", token);
},
success: function (data) {
console.log(data)
@@ -384,7 +403,10 @@
request.setRequestHeader("token", token);
},
success: function (data) {
- layerMenu.push(data);
+ if (parent.getRootById(data.id) == null) {
+ data.isloading = false;
+ layerMenu.push(data);
+ }
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
console.log(errorThrown);
--
Gitblit v1.9.1