修改tip提示语
This commit is contained in:
@ -1500,7 +1500,7 @@ class PolygonObject extends Base {
|
||||
fromDegreesArray = []
|
||||
this.heightMode = this.heightMode
|
||||
|
||||
if(this._positionEditingCallback) {
|
||||
if (this._positionEditingCallback) {
|
||||
this._positionEditingCallback()
|
||||
this._positionEditingCallback = null
|
||||
}
|
||||
@ -1700,19 +1700,20 @@ class PolygonObject extends Base {
|
||||
return this._areaChangeCallBack
|
||||
}
|
||||
|
||||
set areaChangeCallBack (cd) {
|
||||
set areaChangeCallBack(cd) {
|
||||
this._areaChangeCallBack = cd
|
||||
}
|
||||
|
||||
nodeEdit(cb = () => { }) {
|
||||
this.positionEditing = false
|
||||
setTimeout(() => {
|
||||
let previous = [...this.options.positions]
|
||||
if (YJ.Measure.GetMeasureStatus()) {
|
||||
cb('上一次测量未结束')
|
||||
} else {
|
||||
YJ.Measure.SetMeasureStatus(true)
|
||||
this.picking = false
|
||||
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
|
||||
this.tip = new MouseTip('左键单击选择控制点,右键单击取消编辑', this.sdk)
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
this.nodePoints = []
|
||||
let _this = this
|
||||
@ -1848,7 +1849,7 @@ class PolygonObject extends Base {
|
||||
selectPoint = pick.id
|
||||
this.nodePoints.splice(pick.id.index, 1)
|
||||
this.sdk.viewer.entities.remove(pick.id)
|
||||
this.tip.set_text('左键开始,右键结束,CTRL+右键撤销')
|
||||
this.tip.set_text('左键单击确定控制点位置,右键单击结束编辑! CTRL+右键单击撤销上一个控制点')
|
||||
originalPosition = this.cartesian3Towgs84(
|
||||
selectPoint.position.getValue(),
|
||||
this.sdk.viewer
|
||||
@ -1863,6 +1864,51 @@ class PolygonObject extends Base {
|
||||
if (added) {
|
||||
this.options.positions.splice(selectPoint.index, 1)
|
||||
}
|
||||
if (this.options.positions.length < 3) {
|
||||
this.options.positions = [...previous]
|
||||
let positions = this.options.positions
|
||||
let fromDegreesArray = []
|
||||
for (let i = 0; i < positions.length; i++) {
|
||||
fromDegreesArray.push(positions[i].lng, positions[i].lat)
|
||||
}
|
||||
this.positions = Cesium.Cartesian3.fromDegreesArray(
|
||||
fromDegreesArray
|
||||
)
|
||||
newpositions = Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)
|
||||
this.previous = {
|
||||
positions: [...this.positions]
|
||||
}
|
||||
|
||||
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||
let positions2 = [[]]
|
||||
for (let i = 0; i < this.options.positions.length; i++) {
|
||||
positions2[0].push([
|
||||
this.options.positions[i].lng,
|
||||
this.options.positions[i].lat
|
||||
])
|
||||
}
|
||||
positions2[0].push([
|
||||
this.options.positions[0].lng,
|
||||
this.options.positions[0].lat
|
||||
])
|
||||
let polygon = turf.polygon(positions2)
|
||||
let centroid = turf.centroid(polygon)
|
||||
this
|
||||
.getClampToHeight({
|
||||
lng: centroid.geometry.coordinates[0],
|
||||
lat: centroid.geometry.coordinates[1]
|
||||
}, objectsToExclude)
|
||||
.then(height => {
|
||||
this.label.position = [
|
||||
centroid.geometry.coordinates[0],
|
||||
centroid.geometry.coordinates[1],
|
||||
height
|
||||
]
|
||||
})
|
||||
|
||||
this.areaByMeter = this.computeArea(this.options.positions)
|
||||
this.areaChangeCallBack && this.areaChangeCallBack()
|
||||
}
|
||||
cb(null, this.options.positions)
|
||||
}
|
||||
|
||||
@ -2018,6 +2064,9 @@ class PolygonObject extends Base {
|
||||
}
|
||||
}
|
||||
this.nodePoints.pop()
|
||||
if(this.options.positions.length < 3) {
|
||||
this.tip.set_text('左键单击确定控制点位置,右键单击取消编辑! CTRL+右键单击撤销上一个控制点')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user