From 562a250ed18bd862702991d86437703d94cc16c3 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 23 Jun 2021 10:59:28 +0800
Subject: [PATCH] 空间查询

---
 widgets/spatialAnalysis/Widget.js |   94 ++++++++++++++++++++++++++++-------------------
 1 files changed, 56 insertions(+), 38 deletions(-)

diff --git a/widgets/spatialAnalysis/Widget.js b/widgets/spatialAnalysis/Widget.js
index 95e1228..92882b0 100644
--- a/widgets/spatialAnalysis/Widget.js
+++ b/widgets/spatialAnalysis/Widget.js
@@ -31,52 +31,52 @@
 				var that = this;
 				// 暴露在外的接口
 
-                topic.subscribe("closeOnceUse", lang.hitch(this, this.closeOnceUse));
+				topic.subscribe("closeOnceUse", lang.hitch(this, this.closeOnceUse));
 
-				function createTooltip(frameDiv) {//抄录createTooltip函数
+				// function createTooltip(frameDiv) {//抄录createTooltip函数
 
-					var tooltip = function (frameDiv) {
+				// 	var tooltip = function (frameDiv) {
 
-						var div = document.createElement('DIV');
-						div.className = "twipsy right";
+				// 		var div = document.createElement('DIV');
+				// 		div.className = "twipsy right";
 
-						var arrow = document.createElement('DIV');
-						arrow.className = "twipsy-arrow";
-						div.appendChild(arrow);
+				// 		var arrow = document.createElement('DIV');
+				// 		arrow.className = "twipsy-arrow";
+				// 		div.appendChild(arrow);
 
-						var title = document.createElement('DIV');
-						title.className = "twipsy-inner";
-						div.appendChild(title);
+				// 		var title = document.createElement('DIV');
+				// 		title.className = "twipsy-inner";
+				// 		div.appendChild(title);
 
-						this._div = div;
-						this._title = title;
-						this.message = '';
+				// 		this._div = div;
+				// 		this._title = title;
+				// 		this.message = '';
 
-						// add to frame div and display coordinates
-						frameDiv.appendChild(div);
-						var that = this;
-						div.onmousemove = function (evt) {
-							that.showAt({ x: evt.clientX, y: evt.clientY }, that.message);
-						};
-					};
+				// 		// add to frame div and display coordinates
+				// 		frameDiv.appendChild(div);
+				// 		var that = this;
+				// 		div.onmousemove = function (evt) {
+				// 			that.showAt({ x: evt.clientX, y: evt.clientY }, that.message);
+				// 		};
+				// 	};
 
-					tooltip.prototype.setVisible = function (visible) {
-						this._div.style.display = visible ? 'block' : 'none';
-					};
+				// 	tooltip.prototype.setVisible = function (visible) {
+				// 		this._div.style.display = visible ? 'block' : 'none';
+				// 	};
 
-					tooltip.prototype.showAt = function (position, message) {
-						if (position && message) {
-							this.setVisible(true);
-							this._title.innerHTML = message;
-							this._div.style.left = position.x + 10 + "px";
-							this._div.style.top = (position.y - this._div.clientHeight / 2) + "px";
-							this.message = message;
-						}
-					};
+				// 	tooltip.prototype.showAt = function (position, message) {
+				// 		if (position && message) {
+				// 			this.setVisible(true);
+				// 			this._title.innerHTML = message;
+				// 			this._div.style.left = position.x + 10 + "px";
+				// 			this._div.style.top = (position.y - this._div.clientHeight / 2) + "px";
+				// 			this.message = message;
+				// 		}
+				// 	};
 
-					return new tooltip(frameDiv);
-				}
-				window.MYcreateTooltip = createTooltip;//全局使用
+				// 	return new tooltip(frameDiv);
+				// }
+				// window.MYcreateTooltip = createTooltip;//全局使用
 
 				var domHtmls = [//默认
 					{
@@ -118,6 +118,9 @@
 
 				that.beginSpatialAnalysis(domHtmls);
 				var isit = false;
+				$('.ccslius').click(() => {
+					isit = false;
+				})
 				$('.ccsliu').dblclick(() => {//测试开关 点击图例其他的图片
 
 					if (isit) {
@@ -154,6 +157,11 @@
 							}, {//方量分析//做好
 								name: '方量分析',
 								classs: 'volumeAnalysis-tool',
+								img: './images/addL/pdpx.png'
+							}
+							, {//空间查询
+								name: '空间查询',
+								classs: 'spatialQuery-tool',
 								img: './images/addL/pdpx.png'
 							}
 							,
@@ -263,6 +271,13 @@
 					topic.publish('beginVolumeAnalysis', 'beginVolumeAnalysis');
 				})
 
+				//空间查询
+				$('.spatialQuery-tool').click(function () {
+					that.closeOnceUse();
+					$(".jimu-widget-spatialQuery").show();
+					topic.publish('beginSpatialQuery', 'beginSpatialQuery');
+				})
+
 			},
 			closeToolBox: function (item) {
 				if (item != this.name) {
@@ -307,13 +322,16 @@
 					$(".jimu-widget-digTheEarth").hide();
 					topic.publish('closesDigTheEarth');
 				}
-
 				//关闭方量贩分析
 				if ($(".jimu-widget-volumeAnalysis").is(":visible")) {//判断是否隐藏
 					$(".jimu-widget-volumeAnalysis").hide();
 					topic.publish('closesVolumeAnalysis');
 				}
-
+				//关闭空间查询
+				if ($(".jimu-widget-spatialQuery").is(":visible")) {//判断是否隐藏
+					$(".jimu-widget-spatialQuery").hide();
+					topic.publish('closesSpatialQuery');
+				}
 
 
 			},

--
Gitblit v1.9.3