优化扩散圆平移时的lable高度计算
This commit is contained in:
@ -12,7 +12,7 @@ class ContourAnalysis {
|
|||||||
let terrainAvailability = this.viewer.terrainProvider.availability;
|
let terrainAvailability = this.viewer.terrainProvider.availability;
|
||||||
if (!terrainAvailability) {
|
if (!terrainAvailability) {
|
||||||
this.error = '未加载地形数据!'
|
this.error = '未加载地形数据!'
|
||||||
this.tools.message({ type: 'warning', text: this.error })
|
// this.tools.message({ type: 'warning', text: this.error })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.positions = options.positions
|
this.positions = options.positions
|
||||||
|
|||||||
@ -299,8 +299,9 @@ class CircleDiffuse extends Base {
|
|||||||
}
|
}
|
||||||
this.event.mouse_move((movement, cartesian) => {
|
this.event.mouse_move((movement, cartesian) => {
|
||||||
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||||
|
this.options.lng = positions.lng
|
||||||
|
this.options.lat = positions.lat
|
||||||
this.lng = positions.lng
|
this.lng = positions.lng
|
||||||
this.lat = positions.lat
|
|
||||||
this.tip.setPosition(
|
this.tip.setPosition(
|
||||||
cartesian,
|
cartesian,
|
||||||
movement.endPosition.x,
|
movement.endPosition.x,
|
||||||
@ -309,8 +310,9 @@ class CircleDiffuse extends Base {
|
|||||||
})
|
})
|
||||||
this.event.mouse_left((movement, cartesian) => {
|
this.event.mouse_left((movement, cartesian) => {
|
||||||
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||||
|
this.options.lng = positions.lng
|
||||||
|
this.options.lat = positions.lat
|
||||||
this.lng = positions.lng
|
this.lng = positions.lng
|
||||||
this.lat = positions.lat
|
|
||||||
this.event.mouse_move(() => { })
|
this.event.mouse_move(() => { })
|
||||||
this.event.mouse_left(() => { })
|
this.event.mouse_left(() => { })
|
||||||
this.event.mouse_right(() => { })
|
this.event.mouse_right(() => { })
|
||||||
@ -337,8 +339,9 @@ class CircleDiffuse extends Base {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer)
|
||||||
|
this.options.lng = positions.lng
|
||||||
|
this.options.lat = positions.lat
|
||||||
this.lng = positions.lng
|
this.lng = positions.lng
|
||||||
this.lat = positions.lat
|
|
||||||
this.event.mouse_move(() => { })
|
this.event.mouse_move(() => { })
|
||||||
this.event.mouse_left(() => { })
|
this.event.mouse_left(() => { })
|
||||||
this.event.mouse_right(() => { })
|
this.event.mouse_right(() => { })
|
||||||
@ -364,8 +367,9 @@ class CircleDiffuse extends Base {
|
|||||||
}
|
}
|
||||||
this.tip && this.tip.destroy()
|
this.tip && this.tip.destroy()
|
||||||
if (this.lastOptions) {
|
if (this.lastOptions) {
|
||||||
|
this.options.lng = this.lastOptions.lng
|
||||||
|
this.options.lat = this.lastOptions.lat
|
||||||
this.lng = this.lastOptions.lng
|
this.lng = this.lastOptions.lng
|
||||||
this.lat = this.lastOptions.lat
|
|
||||||
}
|
}
|
||||||
this.lastOptions = undefined
|
this.lastOptions = undefined
|
||||||
}
|
}
|
||||||
@ -385,7 +389,13 @@ class CircleDiffuse extends Base {
|
|||||||
}
|
}
|
||||||
set lng(v) {
|
set lng(v) {
|
||||||
this.options.lng = v
|
this.options.lng = v
|
||||||
this.label.position = [v, this.lat]
|
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||||
|
this.getClampToHeight({
|
||||||
|
lng: this.options.lng,
|
||||||
|
lat: this.options.lat
|
||||||
|
}, objectsToExclude).then(height => {
|
||||||
|
this.label.position = [this.options.lng, this.options.lat, height]
|
||||||
|
})
|
||||||
this._elms.lng && this._elms.lng.forEach((item) => {
|
this._elms.lng && this._elms.lng.forEach((item) => {
|
||||||
item.value = v
|
item.value = v
|
||||||
})
|
})
|
||||||
@ -395,7 +405,13 @@ class CircleDiffuse extends Base {
|
|||||||
}
|
}
|
||||||
set lat(v) {
|
set lat(v) {
|
||||||
this.options.lat = v
|
this.options.lat = v
|
||||||
this.label.position = [this.lng, v]
|
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||||
|
this.getClampToHeight({
|
||||||
|
lng: this.options.lng,
|
||||||
|
lat: this.options.lat
|
||||||
|
}, objectsToExclude).then(height => {
|
||||||
|
this.label.position = [this.options.lng, this.options.lat, height]
|
||||||
|
})
|
||||||
this._elms.lat && this._elms.lat.forEach((item) => {
|
this._elms.lat && this._elms.lat.forEach((item) => {
|
||||||
item.value = v
|
item.value = v
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user