修改tip提示语

This commit is contained in:
zh
2025-12-10 14:59:18 +08:00
parent 5b200529b5
commit 44d9ace1c7
30 changed files with 448 additions and 172 deletions

View File

@ -72,7 +72,7 @@ class DrawAssemble extends Draw {
// eslint-disable-next-line no-undef
YJ.Measure.SetMeasureStatus(true)
let into
this.tip = new MouseTip('左键确定,右键取消;', that.sdk)
this.tip = new MouseTip(this.tipText || '左键确定,右键取消;', that.sdk)
this.event = new MouseEvent(that.sdk)
this.positions = []
this.points_ids = [] //存放左键点击时临时添加的point的id
@ -100,6 +100,9 @@ class DrawAssemble extends Draw {
cb(null, array)
this.end()
}
else {
cb(cache_positions.length)
}
})
this.event.mouse_move((movement, cartesian) => {
if (into === '2D') {
@ -147,6 +150,22 @@ class DrawAssemble extends Draw {
this.end()
})
this.event.mouse_right_keyboard_ctrl((movement, cartesian) => {
if(into === '2D') {
return
}
if (this.points_ids.length >= 1) {
if(this.points_ids.length === 1) {
this.viewer.entities.remove(this.assemblePolygon)
this.assemblePolygon = undefined
}
this.remove_entity(this.points_ids.pop()) //移除point
cache_positions.pop()
this.anchorpoints.pop()
cb(cache_positions.length)
}
})
this.event.gesture_pinck_start((movement, cartesian) => {
if (into === '2D') {
return
@ -176,6 +195,7 @@ class DrawAssemble extends Draw {
cache_positions.push(this.cartesian3Towgs84(cartesian))
// console.log(this.cartesian3Towgs84(cartesian))
this.points_ids.push(this.create_point(cartesian))
cb(cache_positions.length)
}
}
})
@ -204,6 +224,9 @@ class DrawAssemble extends Draw {
cb(null, array)
this.end()
}
else {
cb(cache_positions.length)
}
})
this.event2D.mouse_move((movement, cartesian) => {
if (into === '3D') {
@ -250,6 +273,21 @@ class DrawAssemble extends Draw {
cb(null)
this.end()
})
this.event2D.mouse_right_keyboard_ctrl((movement, cartesian) => {
if(into === '3D') {
return
}
if (this.points_ids.length >= 1) {
if(this.points_ids.length === 1) {
this.viewer.entities.remove(this.assemblePolygon)
this.assemblePolygon = undefined
}
this.remove_entity(this.points_ids.pop()) //移除point
cache_positions.pop()
this.anchorpoints.pop()
cb(cache_positions.length)
}
})
this.event2D.gesture_pinck_start((movement, cartesian) => {
if (into === '3D') {
@ -280,6 +318,7 @@ class DrawAssemble extends Draw {
cache_positions.push(this.cartesian3Towgs84(cartesian))
// console.log(this.cartesian3Towgs84(cartesian))
this.points_ids.push(this.create_point(cartesian, this._sdk2D.viewer))
cb(cache_positions.length)
}
}
})