Compare commits
2 Commits
91cc200917
...
f9a3ffb359
Author | SHA1 | Date | |
---|---|---|---|
f9a3ffb359 | |||
f5d915bd58 |
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
Reference in New Issue
Block a user