线 空间长度、投影长度、地表长度bug修改
@ -23,7 +23,7 @@ class PolylineObject extends Base {
|
|||||||
* @description 折线
|
* @description 折线
|
||||||
* @param options {object} 线属性
|
* @param options {object} 线属性
|
||||||
* @param options.name{string} 名称
|
* @param options.name{string} 名称
|
||||||
* @param options.width=3{number} 线宽
|
* @param options.width * @param options.width=3{number} 线宽
|
||||||
* @param options.color=#ff0000 {string} 颜色
|
* @param options.color=#ff0000 {string} 颜色
|
||||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
|
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
|
||||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||||
@ -261,6 +261,7 @@ class PolylineObject extends Base {
|
|||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this.length = this.noseToTail ? this.options.fitLengthByMeter : this.options.lengthByMeter
|
this.length = this.noseToTail ? this.options.fitLengthByMeter : this.options.lengthByMeter
|
||||||
|
break
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let length = this.noseToTail ? this.options.fitLengthByMeter : this.options.lengthByMeter
|
let length = this.noseToTail ? this.options.fitLengthByMeter : this.options.lengthByMeter
|
||||||
@ -279,7 +280,6 @@ class PolylineObject extends Base {
|
|||||||
})
|
})
|
||||||
|
|
||||||
let _this = this
|
let _this = this
|
||||||
|
|
||||||
if (!this.noseToTail) {
|
if (!this.noseToTail) {
|
||||||
this.computeDistance(
|
this.computeDistance(
|
||||||
this.options.positions,
|
this.options.positions,
|
||||||
@ -294,12 +294,10 @@ class PolylineObject extends Base {
|
|||||||
_this.length = res
|
_this.length = res
|
||||||
_this.lengthUnit = '米'
|
_this.lengthUnit = '米'
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
let fromDegreesArray = this.renewPositions(this.options.positions)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get fitLengthUnit() {
|
get fitLengthUnit() {
|
||||||
@ -478,16 +476,20 @@ class PolylineObject extends Base {
|
|||||||
}
|
}
|
||||||
if (v) {
|
if (v) {
|
||||||
if (this.options.fitLengthByMeter > 1000 || this.options.fitLengthByMeter == 1000) {
|
if (this.options.fitLengthByMeter > 1000 || this.options.fitLengthByMeter == 1000) {
|
||||||
document.getElementsByClassName('input-select-unit')[1].querySelectorAll('dd')[1].click()
|
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||||
|
dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||||
} else {
|
} else {
|
||||||
document.getElementsByClassName('input-select-unit')[1].querySelectorAll('dd')[0].click()
|
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||||
|
dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (this.options.lengthByMeter > 1000 || this.options.lengthByMeter == 1000) {
|
if (this.options.lengthByMeter > 1000 || this.options.lengthByMeter == 1000) {
|
||||||
document.getElementsByClassName('input-select-unit')[1].querySelectorAll('dd')[1].click()
|
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||||
|
dom && dom.querySelectorAll('dd')[1] && dom.querySelectorAll('dd')[1].click()
|
||||||
} else {
|
} else {
|
||||||
document.getElementsByClassName('input-select-unit')[1].querySelectorAll('dd')[0].click()
|
let dom = document.getElementsByClassName('input-select-unit')[1]
|
||||||
|
dom && dom.querySelectorAll('dd')[0] && dom.querySelectorAll('dd')[0].click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -554,7 +556,7 @@ class PolylineObject extends Base {
|
|||||||
// 2,
|
// 2,
|
||||||
// ground
|
// ground
|
||||||
// )
|
// )
|
||||||
this.lengthUnit = this.lengthUnit
|
// this.lengthUnit = this.lengthUnit
|
||||||
this._elms.heightMode && (this._elms.heightMode.value = heightModeName)
|
this._elms.heightMode && (this._elms.heightMode.value = heightModeName)
|
||||||
this._elms.heightModeObject && (this._elms.heightModeObject.legp_searchActive(
|
this._elms.heightModeObject && (this._elms.heightModeObject.legp_searchActive(
|
||||||
heightModeName
|
heightModeName
|
||||||
@ -810,29 +812,6 @@ class PolylineObject extends Base {
|
|||||||
}, //点击确认按钮事件回调
|
}, //点击确认按钮事件回调
|
||||||
clear: () => {
|
clear: () => {
|
||||||
this.labelLineColor = 'rgba(0,255,255,0.5)'
|
this.labelLineColor = 'rgba(0,255,255,0.5)'
|
||||||
} //点击清空按钮事件回调
|
|
||||||
})
|
|
||||||
this._elms.labelLineColor[i] = lineColorPicker
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get labelBackgroundColorStart() {
|
|
||||||
return this.options.label.backgroundColor[0]
|
|
||||||
}
|
|
||||||
set labelBackgroundColorStart(v) {
|
|
||||||
this.options.label.backgroundColor[0] = v
|
|
||||||
this.label.backgroundColor = [v, this.label.backgroundColor[1]]
|
|
||||||
if (this._elms.labelBackgroundColorStart) {
|
|
||||||
this._elms.labelBackgroundColorStart.forEach((item, i) => {
|
|
||||||
let labelBackgroundColorStartPicker = new ewPlugins('colorpicker', {
|
|
||||||
el: item.el,
|
|
||||||
size: 'mini', //颜色box类型
|
|
||||||
alpha: true, //是否开启透明度
|
|
||||||
defaultColor: this.labelBackgroundColorStart,
|
|
||||||
disabled: false, //是否禁止打开颜色选择器
|
|
||||||
openPickerAni: 'opacity', //打开颜色选择器动画
|
|
||||||
sure: color => {
|
|
||||||
this.labelBackgroundColorStart = color
|
this.labelBackgroundColorStart = color
|
||||||
}, //点击确认按钮事件回调
|
}, //点击确认按钮事件回调
|
||||||
clear: () => {
|
clear: () => {
|
||||||
@ -2178,7 +2157,8 @@ class PolylineObject extends Base {
|
|||||||
2,
|
2,
|
||||||
this.options['words-name']
|
this.options['words-name']
|
||||||
).then(res => {
|
).then(res => {
|
||||||
_this.options.fitLengthByMeter
|
_this.options.fitLengthByMeter = res
|
||||||
|
_this.lengthUnit = _this.options['length-unit']
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let _this = this
|
let _this = this
|
||||||
@ -2187,17 +2167,18 @@ class PolylineObject extends Base {
|
|||||||
2,
|
2,
|
||||||
this.options['words-name']
|
this.options['words-name']
|
||||||
).then(res => {
|
).then(res => {
|
||||||
_this.options.fitLengthByMeter
|
_this.options.fitLengthByMeter = res
|
||||||
|
_this.lengthUnit = _this.options['length-unit']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.fitLengthUnit = this.options['fit-length-unit']
|
|
||||||
let _this = this
|
let _this = this
|
||||||
this.computeDistance(
|
this.computeDistance(
|
||||||
positions,
|
positions,
|
||||||
2,
|
2,
|
||||||
this.options['words-name']
|
this.options['words-name']
|
||||||
).then(res => {
|
).then(res => {
|
||||||
_this.options.lengthByMeter
|
_this.options.lengthByMeter = res
|
||||||
_this.lengthUnit = this.options['length-unit']
|
_this.lengthUnit = this.options['length-unit']
|
||||||
})
|
})
|
||||||
return fromDegreesArray
|
return fromDegreesArray
|
||||||
|
@ -212,22 +212,12 @@ class Tools {
|
|||||||
arr.push(r)
|
arr.push(r)
|
||||||
}
|
}
|
||||||
let l = arr.length - 1
|
let l = arr.length - 1
|
||||||
arr.forEach((item, index) => {
|
for (let i = 0; i < arr.length - 1; i++) {
|
||||||
if (index !== l) {
|
const position1 = Cesium.Cartesian3.fromDegrees(arr[i].position.lng, arr[i].position.lat, 0);
|
||||||
let posi = [item.position, arr[index + 1].position]
|
const position2 = Cesium.Cartesian3.fromDegrees(arr[i + 1].position.lng, arr[i + 1].position.lat, 0);
|
||||||
let d1 = 0
|
const distance = Cesium.Cartesian3.distance(position1, position2);
|
||||||
for (let i = 0; i < posi.length - 1; i++) {
|
length = length + distance
|
||||||
const position1 = Cesium.Cartesian3.fromDegrees(posi[i].lng, posi[i].lat, posi[i].alt);
|
}
|
||||||
const position2 = Cesium.Cartesian3.fromDegrees(posi[i + 1].lng, posi[i + 1].lat, posi[i + 1].alt);
|
|
||||||
const distance = Cesium.Cartesian3.distance(position1, position2);
|
|
||||||
d1 = d1 + distance
|
|
||||||
}
|
|
||||||
|
|
||||||
let d2 = Math.abs(item.position.alt - arr[index + 1].position.alt)
|
|
||||||
let d3 = Math.sqrt(d1 * d1 + d2 * d2)
|
|
||||||
length += d3
|
|
||||||
}
|
|
||||||
})
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -1273,7 +1263,7 @@ class Tools {
|
|||||||
|
|
||||||
replaceHost(url, host) {
|
replaceHost(url, host) {
|
||||||
let newUrl = url
|
let newUrl = url
|
||||||
if(!url || !host) {
|
if (!url || !host) {
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 18 KiB |