修改线空间长度选择
This commit is contained in:
@ -277,18 +277,29 @@ class PolylineObject extends Base {
|
||||
this._elms.wordsName.forEach(item => {
|
||||
item.value = v
|
||||
})
|
||||
if (this.options.lengthByMeter) {
|
||||
switch (v) {
|
||||
case '空间长度':
|
||||
break
|
||||
case '投影长度':
|
||||
break
|
||||
case '地表长度':
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
let _this = this
|
||||
|
||||
if (!this.noseToTail) {
|
||||
this.computeDistance(
|
||||
this.options.positions,
|
||||
2,
|
||||
v
|
||||
).then(res => {
|
||||
_this.options.lengthByMeter = res
|
||||
if (res > 1000 || res == 1000) {
|
||||
_this.length = (res / 1000).toFixed(5)
|
||||
_this.lengthUnit = '千米'
|
||||
} else {
|
||||
_this.length = res
|
||||
_this.lengthUnit = '米'
|
||||
}
|
||||
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
get fitLengthUnit() {
|
||||
@ -538,11 +549,11 @@ class PolylineObject extends Base {
|
||||
break
|
||||
}
|
||||
|
||||
this.options.lengthByMeter = this.computeDistance(
|
||||
this.options.positions,
|
||||
2,
|
||||
ground
|
||||
)
|
||||
// this.options.lengthByMeter = this.computeDistance(
|
||||
// this.options.positions,
|
||||
// 2,
|
||||
// ground
|
||||
// )
|
||||
this.lengthUnit = this.lengthUnit
|
||||
this._elms.heightMode && (this._elms.heightMode.value = heightModeName)
|
||||
this._elms.heightModeObject && (this._elms.heightModeObject.legp_searchActive(
|
||||
@ -1330,12 +1341,18 @@ class PolylineObject extends Base {
|
||||
PolylineObject.createLabel(that)
|
||||
// that.entity.polyline.positionsLngLat = positions
|
||||
that.renewPolygon(fromDegreesArray)
|
||||
that.options.lengthByMeter = that.computeDistance(positions, 2, ground)
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
that.computeDistance(
|
||||
positions,
|
||||
2
|
||||
).then(res => {
|
||||
that.options.lengthByMeter = res
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// if (this.options['nose-to-tail']) {
|
||||
// let array = []
|
||||
@ -2150,21 +2167,39 @@ class PolylineObject extends Base {
|
||||
alt: fromDegreesArray[i + 2]
|
||||
})
|
||||
}
|
||||
this.options.fitLengthByMeter = this.computeDistance(
|
||||
// this.options.fitLengthByMeter = this.computeDistance(
|
||||
// array,
|
||||
// 2,
|
||||
// ground
|
||||
// )
|
||||
let _this = this
|
||||
this.computeDistance(
|
||||
array,
|
||||
2,
|
||||
ground
|
||||
)
|
||||
this.options['words-name']
|
||||
).then(res => {
|
||||
_this.options.fitLengthByMeter
|
||||
})
|
||||
} else {
|
||||
this.options.fitLengthByMeter = this.computeDistance(
|
||||
let _this = this
|
||||
this.computeDistance(
|
||||
positions,
|
||||
2,
|
||||
ground
|
||||
)
|
||||
this.options['words-name']
|
||||
).then(res => {
|
||||
_this.options.fitLengthByMeter
|
||||
})
|
||||
}
|
||||
this.fitLengthUnit = this.options['fit-length-unit']
|
||||
this.options.lengthByMeter = this.computeDistance(positions, 2, ground)
|
||||
this.lengthUnit = this.options['length-unit']
|
||||
let _this = this
|
||||
this.computeDistance(
|
||||
positions,
|
||||
2,
|
||||
this.options['words-name']
|
||||
).then(res => {
|
||||
_this.options.lengthByMeter
|
||||
_this.lengthUnit = this.options['length-unit']
|
||||
})
|
||||
return fromDegreesArray
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user