From 05c853c4bfb8094088f25bdf4c38dd9eecaca998 Mon Sep 17 00:00:00 2001
From: ansel0926 <ansel0926@gmail.com>
Date: 星期一, 16 五月 2022 10:47:49 +0800
Subject: [PATCH] Merge branch 'master' of ssh://117.78.1.188:29418/DDE-WEB
---
view/project/layerAnalysis.html | 71 ++++++++++++++++++++++++++++++++---
1 files changed, 64 insertions(+), 7 deletions(-)
diff --git a/view/project/layerAnalysis.html b/view/project/layerAnalysis.html
index ad121b3..8ee58f4 100644
--- a/view/project/layerAnalysis.html
+++ b/view/project/layerAnalysis.html
@@ -56,6 +56,11 @@
border-radius: 6px;
background-color: #999;
}
+
+ .layui-tree-btnGroup .layui-icon {
+ display: inline-block;
+ color: white
+ }
</style>
<script>
@@ -64,9 +69,10 @@
layui.use(['tree'], function () {
var tree = layui.tree
isloading = true;
- tree.render({
+ var modelTree = tree.render({
elem: '#model-tree-list'
, data: layerMenu
+ , edit: ["del"]
, showCheckbox: true //鏄惁鏄剧ず澶嶉�夋
, id: 'model-tree-list'
, isJump: false //鏄惁鍏佽鐐瑰嚮鑺傜偣鏃跺脊鍑烘柊绐楀彛璺宠浆
@@ -86,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": {
@@ -112,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];
}
@@ -178,6 +184,22 @@
});
}
+ }
+ 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);
+ 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) {
@@ -256,6 +278,7 @@
let result = modelType == 'Primitive' ? parent.delprimitiveModel(modelId) : parent.delentityModel(modelId);
}
parent.delNodeById(modelId, layerMenu);
+ delDrawEntity(modelId);
}
}
});
@@ -312,6 +335,37 @@
changeParentChecked(ischeck, parentOfData);
}
}
+ //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();
+ }
+ })
+ function delDrawEntity(modelId) {
+ let updateData = {
+ "ids": modelId,
+ }
+ let token = window.localStorage.getItem("token");
+ $.ajax({
+ type: "post",
+ async: false,
+ url: parent.httpConfig.webApiUrl + "landstamp/front/removeDrawEntity",
+ data: updateData,
+ contentType: "application/x-www-form-urlencoded",
+ beforeSend: function (request) {
+ request.setRequestHeader("token", token);
+ },
+ success: function (data) {
+ console.log(data)
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ console.log("ajax璇锋眰澶辫触锛�");
+ }
+ });
+ }
});
</script>
@@ -347,7 +401,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