From f5d915bd584f6b43aa363e135a90f1f11bf9a99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Tue, 26 Aug 2025 14:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/BatchModel/index.js | 6 +++--- src/Obj/Base/TextBox/index.js | 6 ++++++ src/YJEarth/index.js | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Obj/Base/BatchModel/index.js b/src/Obj/Base/BatchModel/index.js index 38b5140..48598bf 100644 --- a/src/Obj/Base/BatchModel/index.js +++ b/src/Obj/Base/BatchModel/index.js @@ -76,8 +76,8 @@ class BatchModel extends Base { }) let dis1 = Cesium.Cartesian3.distance(posi[0], posi[1]) let dis2 = Cesium.Cartesian3.distance(posi[1], posi[2]) - let num1 = dis1 / options.spacing - let num2 = dis2 / options.spacing + let num1 = dis1 / this.options.spacing + let num2 = dis2 / this.options.spacing if (num1 * num2 > 100) { tools.message({ type: 'warning', text: '数量大于100,请重新绘制' }) return; @@ -90,7 +90,7 @@ class BatchModel extends Base { for (let i = 0; i < posi.length - 2; i++) { dis += Cesium.Cartesian3.distance(posi[i], posi[i + 1]) } - if (dis / options.spacing > 100) { + if (dis / this.options.spacing > 100) { tools.message({ type: 'warning', text: '数量大于100,请重新绘制' }) return; } diff --git a/src/Obj/Base/TextBox/index.js b/src/Obj/Base/TextBox/index.js index e0529c0..e143806 100644 --- a/src/Obj/Base/TextBox/index.js +++ b/src/Obj/Base/TextBox/index.js @@ -2,6 +2,7 @@ * 文本框 */ import Base from "../index"; +import { syncData } from '../../../Global/MultiViewportMode' import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' class TextBox extends Base { /** @@ -30,6 +31,9 @@ class TextBox extends Base { this.create(this) this.sdk.addIncetance(this.options.id, this) this.callback = callback + + // syncData(this.sdk, this.options.id) + } get type() { @@ -129,6 +133,7 @@ class TextBox extends Base { async getwords(words) { this.options.text = words this.callback(this.options) + syncData(this.sdk, this.options.id) } async returnFun() { return this.handler @@ -149,6 +154,7 @@ class TextBox extends Base { set show(v) { this.options.show = v this.textDom && (this.textDom.style.display = v ? 'block' : 'none'); + // syncData(this.sdk, this.options.id) } get position() { return this.options.position diff --git a/src/YJEarth/index.js b/src/YJEarth/index.js index b959df3..deaa768 100644 --- a/src/YJEarth/index.js +++ b/src/YJEarth/index.js @@ -419,7 +419,9 @@ class YJEarth { let ClickHandler = new Cesium.ScreenSpaceEventHandler(_this.viewer.canvas) ClickHandler.setInputAction((movement) => { - let textList = document.getElementsByClassName('popup-textarea') + console.log(_this.viewer, 'hhhh') + // let textList = document.getElementsByClassName('popup-textarea') + let textList = _this.viewer._element.getElementsByClassName('popup-textarea') _this.isLeftClick = false for (let i = textList.length - 1; i > -1; i--) { let left = returnNumber(textList[i].style.left) @@ -428,6 +430,7 @@ class YJEarth { let height = textList[i].clientHeight * 1 let x = movement.position.x let y = movement.position.y + console.log(i, left, top, width, height, x, y, 'yyyyy') if (x > left && x < left + width && y > top && y < top + height) { if (_this.clickTextDom) { _this.clickTextDom.style['pointer-events'] = 'none'