立体雷达扫描持续时间duration参数改为速度speed

This commit is contained in:
zh
2025-12-09 10:42:40 +08:00
parent 239fc3ce90
commit 4622ee736c

View File

@ -30,7 +30,7 @@ class RadarScanStereoscopic extends Base {
* @param options.colorOut=rgba(255,255,0,0.3){string} 范围颜色 * @param options.colorOut=rgba(255,255,0,0.3){string} 范围颜色
* @param options.colorIn=rgba(255,0,0,0.3){string} 扫描颜色 * @param options.colorIn=rgba(255,0,0,0.3){string} 扫描颜色
* @param options.radius=10 {number} 半径 * @param options.radius=10 {number} 半径
* @param options.duration=2000 {number} 持续时间 * @param options.speed=1 {number} 扫描速度(倍)
* @param options.label {object} 标签对象 * @param options.label {object} 标签对象
* @param options.label.show {string} 标签显隐 * @param options.label.show {string} 标签显隐
* @param options.label.position {string} 标签位置 * @param options.label.position {string} 标签位置
@ -75,7 +75,7 @@ class RadarScanStereoscopic extends Base {
if(this.options.radius > 999999) { if(this.options.radius > 999999) {
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) this.event = new MouseEvent(this.sdk)
options.label = options.label || {} options.label = options.label || {}
this.options.label = { this.options.label = {
@ -117,7 +117,7 @@ class RadarScanStereoscopic extends Base {
let height = options.alt; 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 arr = calculatePane(that.options, that.options.radius, heading);
let _time = new Date().getTime(); let _time = new Date().getTime();
@ -129,7 +129,7 @@ class RadarScanStereoscopic extends Base {
// _time = tempTime // _time = tempTime
// heading += speed; // 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); arr = calculatePane(that.options, that.options.radius, heading);
}); });
that.entity = viewer.entities.add({ that.entity = viewer.entities.add({
@ -384,11 +384,14 @@ class RadarScanStereoscopic extends Base {
} }
get duration() { get duration() {
return this.options.duration return 1000
} }
set duration(v) { get speed() {
this.options.duration = v return this.options.speed
this._elms.duration && this._elms.duration.forEach((item) => { }
set speed(v) {
this.options.speed = v
this._elms.speed && this._elms.speed.forEach((item) => {
item.value = v item.value = v
}) })
RadarScanStereoscopic.changeParam(this) RadarScanStereoscopic.changeParam(this)
@ -1028,7 +1031,7 @@ class RadarScanStereoscopic extends Base {
this.colorOut = this.originalOptions.colorOut this.colorOut = this.originalOptions.colorOut
this.colorIn = this.originalOptions.colorIn this.colorIn = this.originalOptions.colorIn
this.radius = this.originalOptions.radius this.radius = this.originalOptions.radius
this.duration = this.originalOptions.duration this.speed = this.originalOptions.speed
this.labelShow = this.originalOptions.label.show this.labelShow = this.originalOptions.label.show
this.labelColor = this.originalOptions.label.color this.labelColor = this.originalOptions.label.color
this.labelFontSize = this.originalOptions.label.fontSize this.labelFontSize = this.originalOptions.label.fontSize