距离计算
This commit is contained in:
@ -1878,7 +1878,7 @@ class CircleObject extends Base {
|
||||
entity = null
|
||||
}
|
||||
endpoint = that.cartesian3Towgs84(cartesian, that.viewer)
|
||||
let radius = that.computeDistance([that.options.center, endpoint])
|
||||
let radius = that.computeDistance2([that.options.center, endpoint])
|
||||
that.radius = radius
|
||||
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
@ -1904,7 +1904,7 @@ class CircleObject extends Base {
|
||||
that.event.mouse_move((movement, cartesian) => {
|
||||
entity && (entity.show = true)
|
||||
endpoint = that.cartesian3Towgs84(cartesian, that.viewer)
|
||||
moveRadius = that.computeDistance([that.options.center, endpoint])
|
||||
moveRadius = that.computeDistance2([that.options.center, endpoint])
|
||||
fromDegreesArray = that.createCircle(that.options.center, moveRadius)
|
||||
that.tip.setPosition(
|
||||
cartesian,
|
||||
|
@ -349,7 +349,7 @@ class CurvelineObject extends Base {
|
||||
break
|
||||
}
|
||||
|
||||
this.options.lengthByMeter = this.computeDistance(
|
||||
this.options.lengthByMeter = this.computeDistance2(
|
||||
this.smoothHandle(this.options.positions),
|
||||
2,
|
||||
ground
|
||||
@ -1157,7 +1157,7 @@ class CurvelineObject extends Base {
|
||||
CurvelineObject.createLabel(that)
|
||||
// that.entity.polyline.positionsLngLat = positions
|
||||
that.renewPolygon(fromDegreesArray)
|
||||
that.options.lengthByMeter = that.computeDistance(that.smoothHandle(positions), 2, ground)
|
||||
that.options.lengthByMeter = that.computeDistance2(that.smoothHandle(positions), 2, ground)
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
@ -1169,10 +1169,10 @@ class CurvelineObject extends Base {
|
||||
// for (let i = 0; i < fromDegreesArray.length; i += 2) {
|
||||
// array.push({ lng: fromDegreesArray[i], lat: fromDegreesArray[i + 1] })
|
||||
// }
|
||||
// this.options.fit_length = tool.computeDistance(array)
|
||||
// this.options.fit_length = tool.computeDistance2(array)
|
||||
// }
|
||||
// else {
|
||||
// this.options.fit_length = tool.computeDistance(positions)
|
||||
// this.options.fit_length = tool.computeDistance2(positions)
|
||||
// }
|
||||
// if (this.options.fit_length_unit === 'km') {
|
||||
// this.options.fit_length = this.options.fit_length / 1000
|
||||
@ -1856,13 +1856,13 @@ class CurvelineObject extends Base {
|
||||
alt: fromDegreesArray[i + 2]
|
||||
})
|
||||
}
|
||||
this.options.fitLengthByMeter = this.computeDistance(
|
||||
this.options.fitLengthByMeter = this.computeDistance2(
|
||||
array,
|
||||
2,
|
||||
ground
|
||||
)
|
||||
this.fitLengthUnit = this.options['fit-length-unit']
|
||||
this.options.lengthByMeter = this.computeDistance(this.smoothHandle(positions), 2, ground)
|
||||
this.options.lengthByMeter = this.computeDistance2(this.smoothHandle(positions), 2, ground)
|
||||
this.lengthUnit = this.options['length-unit']
|
||||
return fromDegreesArray
|
||||
}
|
||||
@ -2234,7 +2234,7 @@ class CurvelineObject extends Base {
|
||||
// )
|
||||
// let fromDegreesArray = that.renewPositions(that.options.positions)
|
||||
// that.renewPolygon(fromDegreesArray)
|
||||
// that.options.lengthByMeter = that.computeDistance(
|
||||
// that.options.lengthByMeter = that.computeDistance2(
|
||||
// that.options.positions,
|
||||
// 2,
|
||||
// that.ground
|
||||
|
@ -1322,7 +1322,8 @@ class PolylineObject extends Base {
|
||||
that.renewPolygon(fromDegreesArray)
|
||||
that.computeDistance(
|
||||
positions,
|
||||
2
|
||||
2,
|
||||
that.options['words-name']
|
||||
).then(res => {
|
||||
that.options.lengthByMeter = res
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
|
@ -27,7 +27,7 @@ class Corridor extends Base {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
}
|
||||
|
||||
let length = this.computeDistance(positions)
|
||||
let length = this.computeDistance2(positions)
|
||||
|
||||
let geometry = new Cesium.CorridorGeometry({
|
||||
positions: Cesium.Cartesian3.fromDegreesArray(fromDegreesArray),
|
||||
|
@ -31,7 +31,7 @@ class Corridor extends Base {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
}
|
||||
|
||||
let length = this.computeDistance(positions)
|
||||
let length = this.computeDistance2(positions)
|
||||
|
||||
let geometry = new Cesium.CorridorGeometry({
|
||||
positions: Cesium.Cartesian3.fromDegreesArray(fromDegreesArray),
|
||||
|
@ -94,7 +94,7 @@ class StandText extends Base {
|
||||
let minimumHeights = []
|
||||
let maximumHeights = []
|
||||
let material = this.getMaterial()
|
||||
let width = this.computeDistance(positions)
|
||||
let width = this.computeDistance2(positions)
|
||||
let extrudedHeight = this.aspectRatio ? (width / this.aspectRatio) : 0
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
@ -303,7 +303,7 @@ class StandText extends Base {
|
||||
let minimumHeights = []
|
||||
let maximumHeights = []
|
||||
let material = that.getMaterial()
|
||||
let width = that.computeDistance(positions)
|
||||
let width = that.computeDistance2(positions)
|
||||
let extrudedHeight = that.aspectRatio ? (width / that.aspectRatio) : 0
|
||||
// aspectRatio
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
@ -503,7 +503,7 @@ class StandText extends Base {
|
||||
let fromDegreesArray = []
|
||||
let minimumHeights = []
|
||||
let maximumHeights = []
|
||||
let width = this.computeDistance(positions)
|
||||
let width = this.computeDistance2(positions)
|
||||
let extrudedHeight = this.aspectRatio ? (width / this.aspectRatio) : 0
|
||||
// aspectRatio
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
@ -602,7 +602,7 @@ class StandText extends Base {
|
||||
let fromDegreesArray = []
|
||||
let minimumHeights = []
|
||||
let maximumHeights = []
|
||||
let width = that.computeDistance(positions)
|
||||
let width = that.computeDistance2(positions)
|
||||
let extrudedHeight = that.aspectRatio ? (width / that.aspectRatio) : 0
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
@ -635,7 +635,7 @@ class StandText extends Base {
|
||||
fromDegreesArray = []
|
||||
minimumHeights = []
|
||||
maximumHeights = []
|
||||
width = that.computeDistance(positions)
|
||||
width = that.computeDistance2(positions)
|
||||
extrudedHeight = that.aspectRatio ? (width / that.aspectRatio) : 0
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
@ -680,7 +680,7 @@ class StandText extends Base {
|
||||
fromDegreesArray = []
|
||||
minimumHeights = []
|
||||
maximumHeights = []
|
||||
width = that.computeDistance(positions)
|
||||
width = that.computeDistance2(positions)
|
||||
extrudedHeight = that.aspectRatio ? (width / that.aspectRatio) : 0
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
@ -710,7 +710,7 @@ class StandText extends Base {
|
||||
fromDegreesArray = []
|
||||
minimumHeights = []
|
||||
maximumHeights = []
|
||||
width = that.computeDistance(positions)
|
||||
width = that.computeDistance2(positions)
|
||||
extrudedHeight = that.aspectRatio ? (width / that.aspectRatio) : 0
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
|
Reference in New Issue
Block a user