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/digTheEarth/Widget.js | 32 +++++++++++++++++++++-----------
1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/widgets/digTheEarth/Widget.js b/widgets/digTheEarth/Widget.js
index 18c553f..0288d8d 100644
--- a/widgets/digTheEarth/Widget.js
+++ b/widgets/digTheEarth/Widget.js
@@ -27,7 +27,7 @@
that.closesDigTheEarth();
})
- $("#beginigTheEarth").click(()=>{
+ $("#beginigTheEarth").click(() => {
that.beginDigTheEarth();
})
@@ -52,8 +52,9 @@
// roll: 6.2831853016686185
// }
// });
-
+
var tooltip = window.MYcreateTooltip(viewer._element);
+ // console.log(viewer._element, 534)
//绘制多边形
var handlerPolygon = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Polygon, 0);
handlerPolygon.activeEvt.addEventListener(function (isActive) {
@@ -68,6 +69,9 @@
}
});
handlerPolygon.movingEvt.addEventListener(function (windowPosition) {
+ // console.log(windowPosition,534)
+ // console.log(handlerPolygon.isDrawing,555)
+ // console.log(viewer._element, 534)
if (windowPosition.x < 200 && windowPosition.y < 150) {
tooltip.setVisible(false);
return;
@@ -117,15 +121,17 @@
});
handlerPolygon.activate();
document.getElementById("cleardigTheEarth").onclick = function () {
- viewer.scene.globe.removeAllExcavationRegion();
- if (handlerPolygon.polygon) {
- handlerPolygon.polygon.show = false;
- }
- if (handlerPolygon.polyline) {
- handlerPolygon.polyline.show = false;
- }
+ // viewer.scene.globe.removeAllExcavationRegion();
+ // if (handlerPolygon.polygon) {
+ // handlerPolygon.polygon.show = false;
+ // }
+ // if (handlerPolygon.polyline) {
+ // handlerPolygon.polyline.show = false;
+ // }
// handlerPolygon.polygon.show = false;
// handlerPolygon.polyline.show = false;
+
+ that.closesDigTheEarth();
};
if (!scene.pickPositionSupported) {
@@ -134,8 +140,10 @@
$('#toolbardigTheEarth').show();
$('#loadingbar').remove();
that.handlerPolygon = handlerPolygon;
+ that.tooltip = tooltip;
},
handlerPolygon: '',
+ tooltip: '',
closesDigTheEarth: function () {
// console.log('gaunbi');
var that = this;
@@ -146,8 +154,10 @@
if (that.handlerPolygon.polyline) {
that.handlerPolygon.polyline.show = false;
}
- that.handlerPolygon.deactivate();
-
+ if (that.handlerPolygon.deactivate) {
+ that.handlerPolygon.deactivate();
+ }
+ that.tooltip.setVisible(false);
},
onOpen: function () {
--
Gitblit v1.9.3