修改tip提示语
This commit is contained in:
@ -26,7 +26,7 @@ class DrawSector extends Draw {
|
||||
super.start()
|
||||
let into
|
||||
YJ.Measure.SetMeasureStatus(true)
|
||||
this.tip = new MouseTip('左键确认,右键取消', that.sdk)
|
||||
this.tip = new MouseTip(this.tipText || '左键确认,右键取消', that.sdk)
|
||||
this.event = new MouseEvent(that.sdk)
|
||||
this._sector_id = null; //扇形
|
||||
this._positions = []; //活动点
|
||||
@ -45,6 +45,7 @@ class DrawSector extends Draw {
|
||||
if (this._positions.length < 3) {
|
||||
this.points_ids.push(this.create_point(cartesian));
|
||||
this._positions.push(this.cartesian3Towgs84(cartesian, this.viewer));
|
||||
cb(this._positions.length)
|
||||
}
|
||||
else {
|
||||
this.end()
|
||||
@ -90,6 +91,20 @@ class DrawSector extends Draw {
|
||||
this.end()
|
||||
cb(null)
|
||||
})
|
||||
this.event.mouse_right_keyboard_ctrl((movement, cartesian) => {
|
||||
if(into === '2D') {
|
||||
return
|
||||
}
|
||||
if (this._positions.length >= 1) {
|
||||
this.remove_entity(this.points_ids.pop())
|
||||
this.remove_entity(this.points_ids.pop())
|
||||
this.remove_entity(this._sector_id)
|
||||
this._sector_id = undefined
|
||||
this._positions.pop()
|
||||
this._positions.pop()
|
||||
cb(this._positions.length)
|
||||
}
|
||||
})
|
||||
if (!this._is2D && this._sdk2D) {
|
||||
this.event2D = new MouseEvent(this._sdk2D)
|
||||
this.event2D.mouse_left((movement, cartesian) => {
|
||||
@ -102,6 +117,7 @@ class DrawSector extends Draw {
|
||||
if (this._positions.length < 3) {
|
||||
this.points_ids.push(this.create_point(cartesian, this._sdk2D.viewer));
|
||||
this._positions.push(this.cartesian3Towgs84(cartesian, this.viewer));
|
||||
cb(this._positions.length)
|
||||
}
|
||||
else {
|
||||
this.end()
|
||||
@ -147,6 +163,20 @@ class DrawSector extends Draw {
|
||||
this.end()
|
||||
cb(null)
|
||||
})
|
||||
this.event2D.mouse_right_keyboard_ctrl((movement, cartesian) => {
|
||||
if(into === '3D') {
|
||||
return
|
||||
}
|
||||
if (this._positions.length >= 1) {
|
||||
this.remove_entity(this.points_ids.pop())
|
||||
this.remove_entity(this.points_ids.pop())
|
||||
this.remove_entity(this._sector_id)
|
||||
this._sector_id = undefined
|
||||
this._positions.pop()
|
||||
this._positions.pop()
|
||||
cb(this._positions.length)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user