修改tip提示语
This commit is contained in:
@ -15,7 +15,7 @@ export default class DrawElliptic extends Draw {
|
||||
let into
|
||||
this.entity_ids = []
|
||||
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.elliptic_id = this.randomString() //圆id
|
||||
@ -34,7 +34,7 @@ export default class DrawElliptic extends Draw {
|
||||
let bearing = 0
|
||||
|
||||
this.event.mouse_left((movement, cartesian) => {
|
||||
if(into === '2D') {
|
||||
if (into === '2D') {
|
||||
return
|
||||
}
|
||||
into = '3D'
|
||||
@ -59,8 +59,11 @@ export default class DrawElliptic extends Draw {
|
||||
cache_84_position[2] = pos84
|
||||
}
|
||||
if (clickNum >= 3) {
|
||||
this.end()
|
||||
cb(null, { center, bearing, semiMajorAxis, semiMinorAxis })
|
||||
this.end()
|
||||
cb(null, { center, bearing, semiMajorAxis, semiMinorAxis })
|
||||
}
|
||||
else {
|
||||
cb(clickNum)
|
||||
}
|
||||
// if (clickNum === 2) {
|
||||
// radius_points = cache_points.concat(cartesian)
|
||||
@ -72,14 +75,14 @@ export default class DrawElliptic extends Draw {
|
||||
// }
|
||||
})
|
||||
this.event.mouse_right((movement, cartesian) => {
|
||||
if(into === '2D') {
|
||||
if (into === '2D') {
|
||||
return
|
||||
}
|
||||
this.end()
|
||||
cb(false)
|
||||
})
|
||||
this.event.mouse_move((movement, cartesian) => {
|
||||
if(into === '2D') {
|
||||
if (into === '2D') {
|
||||
return
|
||||
}
|
||||
this.tip.setPosition(
|
||||
@ -94,11 +97,22 @@ export default class DrawElliptic extends Draw {
|
||||
}
|
||||
|
||||
})
|
||||
this.event.mouse_right_keyboard_ctrl((movement, cartesian) => {
|
||||
if (into === '2D') {
|
||||
return
|
||||
}
|
||||
this.remove_entity(this.points_ids.pop())
|
||||
clickNum--
|
||||
cb(clickNum)
|
||||
if(clickNum==0) {
|
||||
this.remove_entity(this.elliptic_id)
|
||||
}
|
||||
})
|
||||
|
||||
if (!this._is2D && this._sdk2D) {
|
||||
this.event2D = new MouseEvent(this._sdk2D)
|
||||
this.event2D.mouse_left((movement, cartesian) => {
|
||||
if(into === '3D') {
|
||||
if (into === '3D') {
|
||||
return
|
||||
}
|
||||
into = '2D'
|
||||
@ -111,7 +125,7 @@ export default class DrawElliptic extends Draw {
|
||||
let pos84 = this.cartesian3Towgs84(cartesian, this.viewer)
|
||||
center = pos84
|
||||
cache_84_position = [pos84, pos84, pos84]
|
||||
|
||||
|
||||
calculateElliptic()
|
||||
createEllipticPolygon(this._sdk2D.viewer)
|
||||
}
|
||||
@ -123,8 +137,11 @@ export default class DrawElliptic extends Draw {
|
||||
cache_84_position[2] = pos84
|
||||
}
|
||||
if (clickNum >= 3) {
|
||||
this.end()
|
||||
cb(null, { center, bearing, semiMajorAxis, semiMinorAxis })
|
||||
this.end()
|
||||
cb(null, { center, bearing, semiMajorAxis, semiMinorAxis })
|
||||
}
|
||||
else {
|
||||
cb(clickNum)
|
||||
}
|
||||
// if (clickNum === 2) {
|
||||
// radius_points = cache_points.concat(cartesian)
|
||||
@ -136,14 +153,14 @@ export default class DrawElliptic extends Draw {
|
||||
// }
|
||||
})
|
||||
this.event2D.mouse_right((movement, cartesian) => {
|
||||
if(into === '3D') {
|
||||
if (into === '3D') {
|
||||
return
|
||||
}
|
||||
this.end()
|
||||
cb(false)
|
||||
})
|
||||
this.event2D.mouse_move((movement, cartesian) => {
|
||||
if(into === '3D') {
|
||||
if (into === '3D') {
|
||||
return
|
||||
}
|
||||
this.tip.setPosition(
|
||||
@ -156,7 +173,7 @@ export default class DrawElliptic extends Draw {
|
||||
if (clickNum !== 0) {
|
||||
calculateElliptic()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user