From 8eb00c8e0f9aad97f0aaf61d06388bc9006b3be5 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 22 Jun 2021 10:06:22 +0800
Subject: [PATCH] 添加地形开挖

---
 widgets/spatialAnalysis/Widget.js |  148 +++++++++++++++++++++++++++++--------------------
 1 files changed, 88 insertions(+), 60 deletions(-)

diff --git a/widgets/spatialAnalysis/Widget.js b/widgets/spatialAnalysis/Widget.js
index 69fbdfe..7b0f1c1 100644
--- a/widgets/spatialAnalysis/Widget.js
+++ b/widgets/spatialAnalysis/Widget.js
@@ -57,65 +57,83 @@
 					// 	classs: 'SQLQuery-tool',
 					// 	img: './images/addL/pdpx.png'
 					// }
+					, {//地形开挖,//做好
+						name: '地形开挖',
+						classs: 'digTheEarth-tool',
+						img: './images/addL/pdpx.png'
+					}
 				];
-				that.beginSpatialAnalysis(domHtmls);
 
-				$('.ccsliuNo').click(() => {//测试开关 点击图例其他的图片
-					var domHtmls = [
-						{
-							name: '可视分析',
-							classs: 'visibleArea-tool',
-							img: './images/addL/ksy.png'
-						}, {
-							name: '剖面分析',
-							classs: 'profileAnalysis-tool',
-							img: './images/addL/剖面分析.png'
-						}
-						, {//https://blog.csdn.net/supermapsupport/article/details/100134590
-							//需要iServer发布成三维服务
-							name: '坡度分析',
-							classs: 'slope-tool',
-							img: './images/addL/pdpx.png'
-						}
-						, {//做好静态,
-							name: '建造实体',
-							classs: 'modelDiagram-tool',
-							img: './images/addL/pdpx.png'
-						}
-						, {//SQL查询,//做好
-							name: 'SQL查询',
-							classs: 'SQLQuery-tool',
-							img: './images/addL/pdpx.png'
-						},
-						{//建造模型
-							name: '建造模型',
-							classs: 'modesssssllll',
-							img: './images/addL/pdpx.png'
-						}
-						,
-						{//清除模型
-							name: '清除模型',
-							classs: 'modesssss2222',
-							img: './images/addL/pdpx.png'
-						}
-					];
-					that.beginSpatialAnalysis(domHtmls);
-					var promise = false;
-					$('.modesssssllll').click(() => {
-						var URL_CONFIG = {
-							SCENE_CBD: 'http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace',
-						}
-						promise = this.map.scene.open(URL_CONFIG.SCENE_CBD);
-					})
-					$('.modesssss2222').click(() => {
-						if (promise) {
-							Cesium.when(promise, function (layer) {
-								for (var i = 0; i < layer.length; i++) {
-									that.map.scene.layers.remove(layer[i].name)
-								}
-							})
-						}
-					})
+				that.beginSpatialAnalysis(domHtmls);
+				var isit = false;
+				$('.ccsliu').dblclick(() => {//测试开关 点击图例其他的图片
+
+					if (isit) {
+						var domHtmls2 = [
+							{
+								name: '可视分析',
+								classs: 'visibleArea-tool',
+								img: './images/addL/ksy.png'
+							}, {
+								name: '剖面分析',
+								classs: 'profileAnalysis-tool',
+								img: './images/addL/剖面分析.png'
+							}
+							, {//https://blog.csdn.net/supermapsupport/article/details/100134590
+								//需要iServer发布成三维服务
+								name: '坡度分析',
+								classs: 'slope-tool',
+								img: './images/addL/pdpx.png'
+							}
+							, {//做好静态,
+								name: '建造实体',
+								classs: 'modelDiagram-tool',
+								img: './images/addL/pdpx.png'
+							}
+							, {//SQL查询,//做好
+								name: 'SQL查询',
+								classs: 'SQLQuery-tool',
+								img: './images/addL/pdpx.png'
+							}
+							, {//地形开挖,//做好
+								name: '地形开挖',
+								classs: 'digTheEarth-tool',
+								img: './images/addL/pdpx.png'
+							}
+							,
+							{//建造模型
+								name: '建造模型',
+								classs: 'modesssssllll',
+								img: './images/addL/pdpx.png'
+							}
+							,
+							{//清除模型
+								name: '清除模型',
+								classs: 'modesssss2222',
+								img: './images/addL/pdpx.png'
+							}
+						];
+						that.beginSpatialAnalysis(domHtmls2);
+						var promise = false;
+						$('.modesssssllll').click(() => {
+							var URL_CONFIG = {
+								SCENE_CBD: 'http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace',
+							}
+							promise = this.map.scene.open(URL_CONFIG.SCENE_CBD);
+						})
+						$('.modesssss2222').click(() => {
+							if (promise) {
+								Cesium.when(promise, function (layer) {
+									for (var i = 0; i < layer.length; i++) {
+										that.map.scene.layers.remove(layer[i].name)
+									}
+								})
+							}
+						})
+					} else {
+						that.beginSpatialAnalysis(domHtmls);
+					}
+					isit = !isit;
 				})
 
 			},
@@ -160,7 +178,7 @@
 					that.closeOnceUse();
 
 					$(".jimu-widget-slope").show();
-					topic.publish('getbeginSlope', this.beginSlope);
+					topic.publish('getbeginSlope', 'this.beginSlope');
 				})
 				//模型
 				$('.modelDiagram-tool').click(function () {
@@ -171,7 +189,14 @@
 				$('.SQLQuery-tool').click(function () {
 					that.closeOnceUse();
 					$(".jimu-widget-SQLQuery").show();
-					topic.publish('beginSQL', this.beginSQL);
+					topic.publish('beginSQL', 'this.beginSQL');
+
+				})
+				//地形开挖
+				$('.digTheEarth-tool').click(function () {
+					that.closeOnceUse('frist');
+					$(".jimu-widget-digTheEarth").show();
+					topic.publish('beginDigTheEarth', 'beginDigTheEarth');
 
 				})
 
@@ -181,7 +206,7 @@
 					$('.tool-y-box').hide();
 				}
 			},
-			closeOnceUse: function () {
+			closeOnceUse: function (who) {
 				var that = this;
 				that.map.scene.globe.depthTestAgainstTerrain = true;
 				// 关闭量算
@@ -214,6 +239,9 @@
 				//清除SQL查询
 				$(".jimu-widget-SQLQuery").hide();
 				topic.publish('closesSQL', 'closesSQL');
+				//关闭地形开挖
+				$(".jimu-widget-digTheEarth").hide();
+				topic.publish('closesDigTheEarth', who);
 
 			},
 			onOpen: function () {

--
Gitblit v1.9.3