From 4622ee736c4ee89b16ed4a51293e0991c717d12e Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Tue, 9 Dec 2025 10:42:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=8B=E4=BD=93=E9=9B=B7=E8=BE=BE=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E6=8C=81=E7=BB=AD=E6=97=B6=E9=97=B4duration=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=94=B9=E4=B8=BA=E9=80=9F=E5=BA=A6speed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/RadarScanStereoscopic/index.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Obj/Base/RadarScanStereoscopic/index.js b/src/Obj/Base/RadarScanStereoscopic/index.js index 958b444..d731a24 100644 --- a/src/Obj/Base/RadarScanStereoscopic/index.js +++ b/src/Obj/Base/RadarScanStereoscopic/index.js @@ -30,7 +30,7 @@ class RadarScanStereoscopic extends Base { * @param options.colorOut=rgba(255,255,0,0.3){string} 范围颜色 * @param options.colorIn=rgba(255,0,0,0.3){string} 扫描颜色 * @param options.radius=10 {number} 半径 - * @param options.duration=2000 {number} 持续时间 + * @param options.speed=1 {number} 扫描速度(倍) * @param options.label {object} 标签对象 * @param options.label.show {string} 标签显隐 * @param options.label.position {string} 标签位置 @@ -75,7 +75,7 @@ class RadarScanStereoscopic extends Base { if(this.options.radius > 999999) { this.options.radius = 999999 } - this.options.duration = options.duration || 2000 + this.options.speed = options.speed || 1 this.event = new MouseEvent(this.sdk) options.label = options.label || {} this.options.label = { @@ -117,7 +117,7 @@ class RadarScanStereoscopic extends Base { let height = options.alt; - let heading = that.options.duration ? 360 / that.options.duration * Cesium.getTimestamp() : 0; + let heading = that.options.speed ? (360 / that.duration * Cesium.getTimestamp() * that.options.speed) : 0; let arr = calculatePane(that.options, that.options.radius, heading); let _time = new Date().getTime(); @@ -129,7 +129,7 @@ class RadarScanStereoscopic extends Base { // _time = tempTime // heading += speed; - heading = that.options.duration ? 360 / that.options.duration * Cesium.getTimestamp() : 0; + heading = that.options.speed ? (360 / that.duration * Cesium.getTimestamp() * that.options.speed) : 0; arr = calculatePane(that.options, that.options.radius, heading); }); that.entity = viewer.entities.add({ @@ -384,11 +384,14 @@ class RadarScanStereoscopic extends Base { } get duration() { - return this.options.duration + return 1000 } - set duration(v) { - this.options.duration = v - this._elms.duration && this._elms.duration.forEach((item) => { + get speed() { + return this.options.speed + } + set speed(v) { + this.options.speed = v + this._elms.speed && this._elms.speed.forEach((item) => { item.value = v }) RadarScanStereoscopic.changeParam(this) @@ -1028,7 +1031,7 @@ class RadarScanStereoscopic extends Base { this.colorOut = this.originalOptions.colorOut this.colorIn = this.originalOptions.colorIn this.radius = this.originalOptions.radius - this.duration = this.originalOptions.duration + this.speed = this.originalOptions.speed this.labelShow = this.originalOptions.label.show this.labelColor = this.originalOptions.label.color this.labelFontSize = this.originalOptions.label.fontSize