From da0872bd7b0056b0cd35b90dff8f8cfce2024aba Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 25 Jun 2021 17:33:49 +0800
Subject: [PATCH] 部分修改
---
widgets/LeftNavigationBar/Widget.js | 67 ++++++++++++++++++++-------------
1 files changed, 40 insertions(+), 27 deletions(-)
diff --git a/widgets/LeftNavigationBar/Widget.js b/widgets/LeftNavigationBar/Widget.js
index ec45049..8380776 100644
--- a/widgets/LeftNavigationBar/Widget.js
+++ b/widgets/LeftNavigationBar/Widget.js
@@ -3,16 +3,16 @@
// 模块描述:显示坐标
///////////////////////////////////////////////////////////////////////////
define([
- 'dojo/_base/declare',
- 'dojo/_base/lang',
- 'dojo/_base/array',
- 'dojo/_base/html',
- 'dojo/topic',
- 'jimu/BaseWidget',
- 'jimu/utils',
- 'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
- 'libs/zTree_v3/js/jquery.ztree.all'
- ],
+ 'dojo/_base/declare',
+ 'dojo/_base/lang',
+ 'dojo/_base/array',
+ 'dojo/_base/html',
+ 'dojo/topic',
+ 'jimu/BaseWidget',
+ 'jimu/utils',
+ 'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
+ 'libs/zTree_v3/js/jquery.ztree.all'
+],
function (declare,
lang,
array,
@@ -102,13 +102,13 @@
var val = $('#left-navigation-bar-main-input').val();
if (val != '') {
var clearOur = () => {
- let dom = $(`[data-id]`);
- dom.removeClass('layui-tree-spread');
- let domDiv = dom.find('.layui-tree-pack');
- domDiv.css({
- 'display': 'none'
- })
- },
+ let dom = $(`[data-id]`);
+ dom.removeClass('layui-tree-spread');
+ let domDiv = dom.find('.layui-tree-pack');
+ domDiv.css({
+ 'display': 'none'
+ })
+ },
a, useit = (d) => {
for (var k in d) {
if (d[k].who == 'father') {
@@ -159,7 +159,7 @@
}
},
- closeToolBox: function (item) {},
+ closeToolBox: function (item) { },
onOpen: function () {
//面板打开的时候触发 (when open this panel trigger)
@@ -343,7 +343,7 @@
tree.render({
elem: '#left-tree-list' //默认是点击节点可进行收缩
- ,
+ ,
data: data,
id: 'demoId1',
showCheckbox: true, //是否显示复选框
@@ -377,6 +377,7 @@
obj.data.children.forEach(item => {
Cesium.when(that[item.id], function (layer) {
topic.publish('removeTilt', 'Layermanagement', item);
+ topic.publish('removeTiltS', 'spatialAnalysis', item);
topic.publish('removeLayersLegends', 'legends', item);
that.map.scene.layers.remove(layer[0].name)
})
@@ -387,7 +388,9 @@
that[item.id] = scene.open(host + partOfUrl, undefined, {
autoSetView: false //不自动定位
});
+ // console.log(222)
topic.publish('appendTilt', 'Layermanagement', item);
+ topic.publish('appendTiltS', 'spatialAnalysis', item);
topic.publish('addLayersLegends', 'legends', item);
//定位到场景
Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) {
@@ -429,7 +432,9 @@
destination: rectangle
});
});
+ // console.log(444)
topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
+ topic.publish('appendItemS', 'spatialAnalysis', item, that[item.id]);
topic.publish('addLayersLegends', 'legends', item);
} else {
$.ajax({
@@ -438,11 +443,12 @@
dataType: 'JSON',
success: function (res) {
-
+ // console.log(111)
that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
url: res[0].path,
}));
topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
+ topic.publish('appendItemS', 'spatialAnalysis', item, that[item.id]);
topic.publish('addLayersLegends', 'legends', item);
that[item.id].alpha = item.alpha;
that[item.id].getViewableRectangle().then(function (rectangle) {
@@ -459,15 +465,13 @@
}
-
-
-
} else {
if (obj.data.model) {
obj.data.children.forEach(item => {
Cesium.when(that[item.id], function (layer) {
topic.publish('removeTilt', 'Layermanagement', item);
+ topic.publish('removeTiltS', 'spatialAnalysis', item);
topic.publish('removeLayersLegends', 'legends', item);
that.map.scene.layers.remove(layer[0].name)
})
@@ -476,6 +480,7 @@
obj.data.children.forEach(item => {
if (that[item.id]) {
topic.publish('removeItem', 'Layermanagement', item);
+ topic.publish('removeItemS', 'spatialAnalysis', item);
topic.publish('removeLayersLegends', 'legends', item);
that[item.id].show = false;
}
@@ -494,6 +499,7 @@
if (obj.data.model) {
Cesium.when(that[obj.data.id], function (layer) {
topic.publish('removeTilt', 'Layermanagement', obj.data);
+ topic.publish('removeTiltS', 'spatialAnalysis', obj.data);
topic.publish('removeLayersLegends', 'legends', obj.data);
that.map.scene.layers.remove(layer[0].name)
})
@@ -507,7 +513,9 @@
that[obj.data.id] = scene.open(host + partOfUrl, undefined, {
autoSetView: false //不自动定位
});
+ // console.log(333)
topic.publish('appendTilt', 'Layermanagement', obj.data);
+ topic.publish('appendTiltS', 'spatialAnalysis', obj.data);
topic.publish('addLayersLegends', 'legends', obj.data);
//定位到场景
Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) {
@@ -544,7 +552,9 @@
destination: rectangle
});
});
+ // console.log(555)
topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
+ topic.publish('appendItemS', 'spatialAnalysis', obj.data, that[obj.data.id]);
topic.publish('addLayersLegends', 'legends', obj.data);
} else {
$.ajax({
@@ -559,6 +569,7 @@
}));
topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
+ topic.publish('appendItemS', 'spatialAnalysis', obj.data, that[obj.data.id]);
topic.publish('addLayersLegends', 'legends', obj.data);
that[obj.data.id].alpha = obj.data.alpha
@@ -583,6 +594,7 @@
Cesium.when(that[obj.data.id], function (layer) {
topic.publish('removeTilt', 'Layermanagement', obj.data);
+ topic.publish('removeTiltS', 'spatialAnalysis', obj.data);
topic.publish('removeLayersLegends', 'legends', obj.data);
that.map.scene.layers.remove(layer[0].name)
})
@@ -591,6 +603,7 @@
if (that[obj.data.id]) {
topic.publish('removeItem', 'Layermanagement', obj.data);
+ topic.publish('removeItemS', 'spatialAnalysis', obj.data);
topic.publish('removeLayersLegends', 'legends', obj.data);
that[obj.data.id].show = false;
}
@@ -691,15 +704,15 @@
title: '采集站点',
id: 1,
field: '1'
- // , checked: true
- ,
+ // , checked: true
+ ,
spread: true,
children: [{
title: '南矶山保护区',
id: 11,
field: '1-1'
- // , checked: true
- ,
+ // , checked: true
+ ,
spread: true,
children: [{
title: '北深渊',
--
Gitblit v1.9.3