This commit is contained in:
2025-11-12 17:34:53 +08:00
parent b4fd967930
commit ae84184bf8
3 changed files with 120 additions and 13 deletions

View File

@ -384,13 +384,15 @@ class Submerge extends Tools {
move() {
if (this.TweenAnimate) {
TWEEN.remove(this.TweenAnimate)
// if (this.TweenAnimate) {
// TWEEN.remove(this.TweenAnimate)
// }
if (!this.TweenAnimate) {
let totalTime = ((this.options.maxWaterLevel - this.options.minWaterLevel) / this.options.risingSpeed) * 1000
this.TweenAnimate = new TWEEN.Tween({ waterLevel: this.options.minWaterLevel }).to({ waterLevel: this.options.maxWaterLevel }, totalTime).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(async (r, a) => {
this.currentWaterLaver = r.waterLevel
}).start()
}
let totalTime = ((this.options.maxWaterLevel - this.options.minWaterLevel) / this.options.risingSpeed) * 1000
this.TweenAnimate = new TWEEN.Tween({ waterLevel: this.options.minWaterLevel }).to({ waterLevel: this.options.maxWaterLevel }, totalTime).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(async (r, a) => {
this.currentWaterLaver = r.waterLevel
}).start()
// let contentElm = this._DialogObject._element.body
// let pauseBtn = contentElm.getElementsByClassName('pause')[0];
// let startBtn = contentElm.getElementsByClassName('start')[0];
@ -409,9 +411,9 @@ class Submerge extends Tools {
this.TweenAnimate = new TWEEN.Tween({ waterLevel: this.options.minWaterLevel }).to({ waterLevel: this.options.maxWaterLevel }, totalTime).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(async (r, a) => {
this.currentWaterLaver = r.waterLevel
}).start()
if (isPaused) {
this.pause()
}
// if (isPaused) {
this.pause()
// }
}
start() {

View File

@ -43,7 +43,7 @@ class ViewShedStage extends Tools {
this.options = {}
this.options.viewPosition = options.viewPosition;
this.options.viewPositionEnd = options.viewPositionEnd;
this.options.horizontalViewAngle = (options.horizontalViewAngle || options.horizontalViewAngle === 0) ? options.horizontalViewAngle : 90.0;
this.options.horizontalViewAngle = (options.horizontalViewAngle || options.horizontalViewAngle === 0) ? options.horizontalViewAngle : 30.0;
this.options.verticalViewAngle = (options.verticalViewAngle || options.verticalViewAngle === 0) ? options.verticalViewAngle : 60.0;
this.options.visibleAreaColor = options.visibleAreaColor || '#008000';
this.options.invisibleAreaColor = options.invisibleAreaColor || '#FF0000';
@ -182,7 +182,7 @@ class ViewShedStage extends Tools {
return pitch
}
static create(that) {
static create(that, callBack) {
that.destroy()
let count = 0;
if (!YJ.Measure.GetMeasureStatus()) {
@ -201,6 +201,7 @@ class ViewShedStage extends Tools {
that.ids.push(ViewShedStage.create_point(that, cartesian))
that.end()
that.update()
callBack(true)
}
})
that.event.mouse_move((movement, cartesian) => {
@ -212,6 +213,7 @@ class ViewShedStage extends Tools {
})
that.ids = []
that.end()
callBack(false)
})
that.event.gesture_pinck_start((movement, cartesian) => {
let startTime = new Date()
@ -223,6 +225,7 @@ class ViewShedStage extends Tools {
})
that.ids = []
that.end()
callBack(false)
}
})
})
@ -232,6 +235,7 @@ class ViewShedStage extends Tools {
text: '上一次测量未结束',
type: 'warning',
});
callBack(false)
}
@ -247,8 +251,8 @@ class ViewShedStage extends Tools {
this.tip = null
this.event = null
}
draw() {
ViewShedStage.create(this)
draw(callBack) {
ViewShedStage.create(this, callBack)
}
static create_point(that, cartesian) {