修改tip提示语
This commit is contained in:
@ -21,7 +21,7 @@ export default class DrawCircle extends Draw {
|
||||
super.start()
|
||||
let into
|
||||
YJ.Measure.SetMeasureStatus(true)
|
||||
this.tip = new MouseTip('左键开始,右键取消', this.sdk)
|
||||
this.tip = new MouseTip(this.tipText || '左键开始,右键取消', this.sdk)
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
let clickNum = 0
|
||||
this.circle_id = this.randomString() //圆id
|
||||
@ -37,7 +37,7 @@ export default class DrawCircle extends Draw {
|
||||
return
|
||||
}
|
||||
into = '3D'
|
||||
this.tip.set_text('再次左键,完成绘制;右键取消')
|
||||
this.tip.set_text(this.tipText || '再次左键,完成绘制;右键取消')
|
||||
clickNum++
|
||||
if (clickNum === 1) {
|
||||
this.point_id = this.create_point(cartesian)
|
||||
@ -45,6 +45,7 @@ export default class DrawCircle extends Draw {
|
||||
positions = this.createCircle(center, 0.01)
|
||||
cache_points.push(cartesian)
|
||||
createCirclePolygon()
|
||||
cb(clickNum)
|
||||
}
|
||||
if (clickNum === 2) {
|
||||
radius_points = cache_points.concat(cartesian)
|
||||
@ -77,7 +78,24 @@ export default class DrawCircle extends Draw {
|
||||
radius = this.computeDistance2([center, endpoint])
|
||||
positions = this.createCircle(center, radius)
|
||||
}
|
||||
})
|
||||
|
||||
this.event.mouse_right_keyboard_ctrl((movement, cartesian) => {
|
||||
if(into === '2D') {
|
||||
return
|
||||
}
|
||||
if (this.point_id) {
|
||||
this.remove_entity(this.circle_id)
|
||||
this.remove_entity(this.point_id)
|
||||
this.point_id = null
|
||||
cache_points = []
|
||||
radius_points = []
|
||||
positions = []
|
||||
center = {}
|
||||
endpoint = null
|
||||
clickNum = 0
|
||||
cb(clickNum)
|
||||
}
|
||||
})
|
||||
|
||||
this.event.gesture_pinck_start((movement, cartesian) => {
|
||||
@ -92,7 +110,7 @@ export default class DrawCircle extends Draw {
|
||||
cb(false)
|
||||
}
|
||||
else {
|
||||
this.tip.set_text('再次左键,完成绘制;右键取消')
|
||||
this.tip.set_text(this.tipText || '再次左键,完成绘制;右键取消')
|
||||
clickNum++
|
||||
if (clickNum === 1) {
|
||||
this.point_id = this.create_point(cartesian)
|
||||
@ -104,6 +122,7 @@ export default class DrawCircle extends Draw {
|
||||
(movement.position1.x + movement.position2.x) / 2,
|
||||
(movement.position1.y + movement.position2.y) / 2
|
||||
)
|
||||
cb(clickNum)
|
||||
}
|
||||
if (clickNum === 2) {
|
||||
radius_points = cache_points.concat(cartesian)
|
||||
@ -124,7 +143,7 @@ export default class DrawCircle extends Draw {
|
||||
return
|
||||
}
|
||||
into = '2D'
|
||||
this.tip.set_text('再次左键,完成绘制;右键取消')
|
||||
this.tip.set_text(this.tipText || '再次左键,完成绘制;右键取消')
|
||||
clickNum++
|
||||
if (clickNum === 1) {
|
||||
this.point_id = this.create_point(cartesian, this._sdk2D.viewer)
|
||||
@ -132,6 +151,7 @@ export default class DrawCircle extends Draw {
|
||||
positions = this.createCircle(center, 0.01)
|
||||
cache_points.push(cartesian)
|
||||
createCirclePolygon(this._sdk2D.viewer)
|
||||
cb(clickNum)
|
||||
}
|
||||
if (clickNum === 2) {
|
||||
radius_points = cache_points.concat(cartesian)
|
||||
@ -179,7 +199,7 @@ export default class DrawCircle extends Draw {
|
||||
cb(false)
|
||||
}
|
||||
else {
|
||||
this.tip.set_text('再次左键,完成绘制;右键取消')
|
||||
this.tip.set_text(this.tipText || '再次左键,完成绘制;右键取消')
|
||||
clickNum++
|
||||
if (clickNum === 1) {
|
||||
this.point_id = this.create_point(cartesian, this._sdk2D.viewer)
|
||||
@ -191,6 +211,7 @@ export default class DrawCircle extends Draw {
|
||||
((movement.position1.x + movement.position2.x) / 2) + this.viewer.canvas.width,
|
||||
(movement.position1.y + movement.position2.y) / 2
|
||||
)
|
||||
cb(clickNum)
|
||||
}
|
||||
if (clickNum === 2) {
|
||||
radius_points = cache_points.concat(cartesian)
|
||||
@ -203,6 +224,24 @@ export default class DrawCircle extends Draw {
|
||||
}
|
||||
})
|
||||
})
|
||||
this.event2D.mouse_right_keyboard_ctrl((movement, cartesian) => {
|
||||
if(into === '3D') {
|
||||
return
|
||||
}
|
||||
if (this.point_id) {
|
||||
this.remove_entity(this.circle_id)
|
||||
this.remove_entity(this.point_id)
|
||||
this.point_id = null
|
||||
cache_points = []
|
||||
radius_points = []
|
||||
positions = []
|
||||
center = {}
|
||||
endpoint = null
|
||||
clickNum = 0
|
||||
cb(clickNum)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
let that = this
|
||||
|
||||
Reference in New Issue
Block a user