线样式(无同步间距调节)

This commit is contained in:
2025-07-07 16:21:01 +08:00
parent 484fe70e16
commit fa3325580c
8 changed files with 373 additions and 77 deletions

View File

@ -57,6 +57,10 @@ class PolylineObject extends Base {
this.options['nose-to-tail'] = options['nose-to-tail'] || false
this.options.smooth = options.smooth || false
this.options.extend = options.extend || false
this.options.rotate = options.rotate || true
this.options.space = options.space || 0.1
this.options.speed = options.speed || 1
this.options.dashSize = options.dashSize || 0.03
this.options['length-unit'] = options['length-unit'] || '米'
this.options['fit-length-unit'] = options['fit-length-unit'] || '米'
this.options['extend-width'] =
@ -144,7 +148,7 @@ class PolylineObject extends Base {
}
set color(v) {
this.options.color = v
this.entity.polyline.material = this.getMaterial(v, this.options.type)
this.entity.polyline.material = this.getMaterial(v, this.options.type, this.entity, this.options)
if (this._elms.color) {
this._elms.color.forEach((item, i) => {
let colorPicker = new ewPlugins('colorpicker', {
@ -166,6 +170,48 @@ class PolylineObject extends Base {
}
}
get speed() {
return this.options.speed
}
set speed(v) {
this.options.speed = v
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
}
get dashSize() {
return this.options.dashSize
}
set dashSize(v) {
this.options.dashSize = v
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
}
get rotate() {
return this.options.rotate
}
set rotate(v) {
this.options.rotate = v
PolylineObject.closeNodeEdit(this)
this._elms.rotate &&
this._elms.rotate.forEach(item => {
item.checked = v
})
this.options.rotate = v
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
}
get space() {
return this.options.space
}
set space(v) {
this.options.space = v
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
}
get length() {
return this.options.length
}
@ -298,6 +344,31 @@ class PolylineObject extends Base {
name: '流动箭头1',
value: '流动箭头1',
key: 7
},
{
name: '流动箭头2',
value: '流动箭头2',
key: 8
},
{
name: '流动箭头3',
value: '流动箭头3',
key: 9
},
{
name: '流动箭头4',
value: '流动箭头4',
key: 10
},
{
name: '流动箭头5',
value: '流动箭头5',
key: 11
},
{
name: '流动箭头6',
value: '流动箭头6',
key: 12
}
]
this.options.type = Number(v)
@ -306,6 +377,16 @@ class PolylineObject extends Base {
this._elms.lineType &&
this._elms.lineType.forEach(item => {
item.value = lineTypeData[i].value
if (2 < item.value && item.value < 13) {//贴图参数
document.getElementById('dashTextureDom').style.display = 'flex'
} else {
document.getElementById('dashTextureDom').style.display = 'none'
}
if (2 < item.value && item.value < 5) {//尾迹参数
document.getElementById('lineSpace').style.display = 'none'
} else {
document.getElementById('lineSpace').style.display = 'flex'
}
})
break
}
@ -314,7 +395,9 @@ class PolylineObject extends Base {
this.entity.polyline &&
(this.entity.polyline.material = this.getMaterial(
this.options.color,
this.options.type
this.options.type,
this.entity,
this.options
))
}
get noseToTail() {
@ -1177,7 +1260,7 @@ class PolylineObject 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, that.entity, that.options),
zIndex: that.sdk._entityZIndex
}
})
@ -1540,6 +1623,31 @@ class PolylineObject extends Base {
name: '流动箭头1',
value: '流动箭头1',
key: 7
},
{
name: '流动箭头2',
value: '流动箭头2',
key: 8
},
{
name: '流动箭头3',
value: '流动箭头3',
key: 9
},
{
name: '流动箭头4',
value: '流动箭头4',
key: 10
},
{
name: '流动箭头5',
value: '流动箭头5',
key: 11
},
{
name: '流动箭头6',
value: '流动箭头6',
key: 12
}
]
let lineTypeDataLegpObject = legp(
@ -1565,6 +1673,18 @@ class PolylineObject extends Base {
for (let i = 0; i < lineTypeData.length; i++) {
if (lineTypeData[i].value === lineTypeDataLegpElm.value) {
this.lineType = lineTypeData[i].key
//控制参数显隐
if (2 < this.lineType && this.lineType < 13) {//贴图参数
document.getElementById('dashTextureDom').style.display = 'flex'
} else {
document.getElementById('dashTextureDom').style.display = 'none'
}
if (2 < this.lineType && this.lineType < 5) {//尾迹参数
document.getElementById('lineSpace').style.display = 'none'
} else {
document.getElementById('lineSpace').style.display = 'flex'
}
break
}
}
@ -1984,6 +2104,10 @@ class PolylineObject extends Base {
this.attributeVr = this.options.attribute.vr.content
this.attributeCamera = this.options.attribute.camera.content
this.attributeGoods = this.options.attribute.goods.content
this.rotate = this.originalOptions.rotate
this.speed = this.originalOptions.speed
this.dashSize = this.originalOptions.dashSize
this.space = this.originalOptions.space
this.cameraSelect && this.cameraSelect()
this.goodsSelect && this.goodsSelect()