From dd213e8337a2b6073478a95d24c7a22b622a179b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Fri, 22 Aug 2025 16:43:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=80=9F=E7=8E=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/PolylineObject/index.js | 39 +++++++++++++++++++++------- src/Tools/index.js | 1 - 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/Obj/Base/PolylineObject/index.js b/src/Obj/Base/PolylineObject/index.js index c1c148b..308fd13 100644 --- a/src/Obj/Base/PolylineObject/index.js +++ b/src/Obj/Base/PolylineObject/index.js @@ -122,6 +122,7 @@ class PolylineObject extends Base { this.operate = {} this.nodePoints = [] this.unitNum = 0 + this.inputSpeed = (options.speed && Math.pow(options.speed, -1) * 100) || 10 this.Dialog = _Dialog if (!this.options.positions || this.options.positions.length < 2) { this._error = '线段最少需要两个坐标!' @@ -150,7 +151,10 @@ class PolylineObject extends Base { } set color(v) { this.options.color = v || '#ff0000' - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) if (this._elms.color) { this._elms.color.forEach((item, i) => { let colorPicker = new YJColorPicker({ @@ -177,9 +181,13 @@ class PolylineObject extends Base { } set speed(v) { - // this.options.speed = v - this.options.speed = v !== 0 ? Math.pow(v, -1) * 100 : 0 - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.options.speed = v + this.inputSpeed = v !== 0 ? Math.pow(v, -1) * 100 : 0 + let params = { ...this.options } + params.speed = this.inputSpeed + // this.options.speed = v !== 0 ? Math.pow(v, -1) * 100 : 0 + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) } get dashSize() { return this.options.dashSize @@ -187,7 +195,10 @@ class PolylineObject extends Base { set dashSize(v) { this.options.dashSize = v - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) } get rotate() { @@ -203,7 +214,10 @@ class PolylineObject extends Base { }) this.options.rotate = v - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) } get space() { @@ -212,7 +226,10 @@ class PolylineObject extends Base { set space(v) { this.options.space = v - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) } get length() { @@ -454,13 +471,15 @@ class PolylineObject extends Base { break } } + let params = { ...this.options } + params.speed = this.inputSpeed this.entity && this.entity.polyline && (this.entity.polyline.material = this.getMaterial( this.options.color, this.options.type, this.entity, - this.options + params )) } get noseToTail() { @@ -1329,11 +1348,13 @@ class PolylineObject extends Base { that.entity.polyline.oriWidth = that.options.width that.judgeLine(that.entity, that.options) + let params = { ...that.options } + params.speed = that.inputSpeed that.entity.polyline.material = that.getMaterial( that.options.color, that.options.type, that.entity, - that.options + params ) that.sdk._entityZIndex++ PolylineObject.createLabel(that) diff --git a/src/Tools/index.js b/src/Tools/index.js index 7716ae3..fe1f38c 100644 --- a/src/Tools/index.js +++ b/src/Tools/index.js @@ -598,7 +598,6 @@ class Tools { if (entity) { arr[type + ''] ? (entity.polyline.width = entity.polyline.oriWidth + arr[type + '']) : (entity.polyline.width = entity.polyline.oriWidth) } - switch (Number(type)) { case 1: //虚线 From 8618508d3f651e94f3d7d03c4f1f66eeda5a596d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Fri, 22 Aug 2025 16:48:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/CurvelineObject/index.js | 37 ++++++++++++++++++++------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/Obj/Base/CurvelineObject/index.js b/src/Obj/Base/CurvelineObject/index.js index fc8b569..aec879c 100644 --- a/src/Obj/Base/CurvelineObject/index.js +++ b/src/Obj/Base/CurvelineObject/index.js @@ -122,6 +122,7 @@ class CurvelineObject extends Base { this.operate = {} this.nodePoints = [] this.unitNum = 0 + this.inputSpeed = (options.speed && Math.pow(options.speed, -1) * 100) || 10 this.Dialog = _Dialog if (!this.options.positions || this.options.positions.length < 2) { this._error = '线段最少需要两个坐标!' @@ -151,7 +152,10 @@ class CurvelineObject extends Base { set color(v) { this.options.color = v || '#ff0000' // this.entity.polyline.material = this.getMaterial(v, this.options.type) - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) if (this._elms.color) { this._elms.color.forEach((item, i) => { let colorPicker = new YJColorPicker({ @@ -177,9 +181,13 @@ class CurvelineObject extends Base { } set speed(v) { - // this.options.speed = v - this.options.speed = v !== 0 ? Math.pow(v, -1) * 100 : 0 - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.options.speed = v + // this.options.speed = v !== 0 ? Math.pow(v, -1) * 100 : 0 + this.inputSpeed = v !== 0 ? Math.pow(v, -1) * 100 : 0 + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) } get dashSize() { return this.options.dashSize @@ -187,7 +195,10 @@ class CurvelineObject extends Base { set dashSize(v) { this.options.dashSize = v - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) } get rotate() { @@ -212,7 +223,10 @@ class CurvelineObject extends Base { set space(v) { this.options.space = v - this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + let params = { ...this.options } + params.speed = this.inputSpeed + // this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options) + this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params) } get length() { @@ -446,13 +460,15 @@ class CurvelineObject extends Base { break } } + let params = { ...this.options } + params.speed = this.inputSpeed this.entity && this.entity.polyline && (this.entity.polyline.material = this.getMaterial( this.options.color, this.options.type, this.entity, - this.options + params )) } get noseToTail() { @@ -1332,18 +1348,21 @@ class CurvelineObject extends Base { positions: Cesium.Cartesian3.fromDegreesArrayHeights(fromDegreesArray), width: that.options.width, clampToGround: ground, - material: that.getMaterial(that.options.color, that.options.type), + // material: that.getMaterial(that.options.color, that.options.type), zIndex: that.sdk._entityZIndex } }) that.entity.polyline.oriWidth = that.options.width that.judgeLine(that.entity, that.options) + + let params = { ...that.options } + params.speed = that.inputSpeed that.entity.polyline.material = that.getMaterial( that.options.color, that.options.type, that.entity, - that.options + params ) that.sdk._entityZIndex++ From 5f6211a01d5fb0847944817fd85e6a9512f96381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Fri, 22 Aug 2025 17:36:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=A1=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=87=E5=AD=97=E8=B6=85=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/TextBox/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Obj/Base/TextBox/index.js b/src/Obj/Base/TextBox/index.js index 5e5697b..0179243 100644 --- a/src/Obj/Base/TextBox/index.js +++ b/src/Obj/Base/TextBox/index.js @@ -53,7 +53,7 @@ class TextBox extends Base { // 配置CSS样式和内容结构 viewer.cesiumWidget.container.appendChild(dom); - let posi = Cesium.Cartesian3.fromDegrees(that.options.position.lng, that.options.position.lat, that.options.position.alt) + let posi = Cesium.Cartesian3.fromDegrees(that.options.position.lng.toFixed(4), that.options.position.lat.toFixed(4), that.options.position.alt.toFixed(4)) that.handler = function () { const position = Cesium.SceneTransforms.wgs84ToWindowCoordinates( @@ -85,7 +85,7 @@ class TextBox extends Base { lat: latitude, alt: cartographic.height } - let posi = Cesium.Cartesian3.fromDegrees(longitude, latitude, cartographic.height) + let posi = Cesium.Cartesian3.fromDegrees(longitude.toFixed(4), latitude.toFixed(4), cartographic.height.toFixed(4)) that.handler = function () { const position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(