From f26fde54fdc51424030eed8e9a0fc4c6529f1ac2 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 25 Jun 2021 08:44:18 +0800
Subject: [PATCH] 空间分析

---
 widgets/slope/Widget.js |   46 +---------------------------------------------
 1 files changed, 1 insertions(+), 45 deletions(-)

diff --git a/widgets/slope/Widget.js b/widgets/slope/Widget.js
index 90c394f..65114f2 100644
--- a/widgets/slope/Widget.js
+++ b/widgets/slope/Widget.js
@@ -59,51 +59,7 @@
                 slope.ColorTable = colorTable;
                 slope.Opacity = 1;
 
-                function createTooltip(frameDiv) {//创建需要的函数
-
-                    var tooltip = function (frameDiv) {
-
-                        var div = document.createElement('DIV');
-                        div.className = "twipsy right";
-
-                        var arrow = document.createElement('DIV');
-                        arrow.className = "twipsy-arrow";
-                        div.appendChild(arrow);
-
-                        var title = document.createElement('DIV');
-                        title.className = "twipsy-inner";
-                        div.appendChild(title);
-
-                        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);
-                        };
-                    };
-
-                    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;
-                        }
-                    };
-
-                    return new tooltip(frameDiv);
-                }
-
-                var tooltip = createTooltip(viewer._element);
+                var tooltip = window.MYcreateTooltip(viewer._element);
                 //绘制多边形
                 var handlerPolygon = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Polygon, 0);
                 handlerPolygon.activeEvt.addEventListener(function (isActive) {

--
Gitblit v1.9.3