From 1a2c1d005bf7de2528f73638fb24d31da812aad5 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 22 Jun 2021 17:40:13 +0800
Subject: [PATCH] 增加模型

---
 widgets/digTheEarth/Widget.js |   72 +++++++----------------------------
 1 files changed, 15 insertions(+), 57 deletions(-)

diff --git a/widgets/digTheEarth/Widget.js b/widgets/digTheEarth/Widget.js
index 0280d81..18c553f 100644
--- a/widgets/digTheEarth/Widget.js
+++ b/widgets/digTheEarth/Widget.js
@@ -27,7 +27,10 @@
                     that.closesDigTheEarth();
                 })
 
-                // that.beginDigTheEarth();
+                $("#beginigTheEarth").click(()=>{
+                    that.beginDigTheEarth();
+
+                })
             },
             beginDigTheEarth: function () {
                 var that = this
@@ -49,50 +52,8 @@
                 //         roll: 6.2831853016686185
                 //     }
                 // });
-                function createTooltip(frameDiv) {//抄录createTooltip函数
-
-                    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) {
@@ -175,21 +136,18 @@
                 that.handlerPolygon = handlerPolygon;
             },
             handlerPolygon: '',
-            closesDigTheEarth: function (froms) {
+            closesDigTheEarth: function () {
                 // console.log('gaunbi');
                 var that = this;
-                if (froms == 'frist') {
-                    // console.log('frist');
-                } else {
-                    that.map.scene.globe.removeAllExcavationRegion();
-                    if (that.handlerPolygon.polygon) {
-                        that.handlerPolygon.polygon.show = false;
-                    }
-                    if (that.handlerPolygon.polyline) {
-                        that.handlerPolygon.polyline.show = false;
-                    }
-                    that.handlerPolygon.deactivate();
+                that.map.scene.globe.removeAllExcavationRegion();
+                if (that.handlerPolygon.polygon) {
+                    that.handlerPolygon.polygon.show = false;
                 }
+                if (that.handlerPolygon.polyline) {
+                    that.handlerPolygon.polyline.show = false;
+                }
+                that.handlerPolygon.deactivate();
+
             },
             onOpen: function () {
 

--
Gitblit v1.9.3