轨迹运动增加反向
This commit is contained in:
@ -239,7 +239,9 @@ class CurvelineObject extends Base {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.options.rotate = v
|
this.options.rotate = v
|
||||||
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
|
let params = { ...this.options }
|
||||||
|
params.speed = this.inputSpeed
|
||||||
|
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
get space() {
|
get space() {
|
||||||
@ -2590,10 +2592,14 @@ class CurvelineObject extends Base {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
nodeEdit(cd) {
|
nodeEdit(cd) {
|
||||||
|
let lastHeightMode = this.heightMode
|
||||||
this.positionEditing = false
|
this.positionEditing = false
|
||||||
|
this.heightMode = 0
|
||||||
if (YJ.Measure.GetMeasureStatus()) {
|
if (YJ.Measure.GetMeasureStatus()) {
|
||||||
} else {
|
} else {
|
||||||
this.closeNodeEdit()
|
this.closeNodeEdit()
|
||||||
|
this._lastHeightMode = lastHeightMode
|
||||||
|
YJ.Measure.SetMeasureStatus(true)
|
||||||
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
|
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
|
||||||
this.event = new MouseEvent(this.sdk)
|
this.event = new MouseEvent(this.sdk)
|
||||||
this.ControllerObject = new Controller(this.sdk)
|
this.ControllerObject = new Controller(this.sdk)
|
||||||
@ -2643,6 +2649,11 @@ class CurvelineObject extends Base {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.event.mouse_right((movement, cartesian) => {
|
this.event.mouse_right((movement, cartesian) => {
|
||||||
|
let _lastHeightMode = this._lastHeightMode
|
||||||
|
this._lastHeightMode = null
|
||||||
|
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||||
|
this.heightMode = _lastHeightMode
|
||||||
|
}
|
||||||
for (let i = 0; i < this.nodePoints.length; i++) {
|
for (let i = 0; i < this.nodePoints.length; i++) {
|
||||||
this.sdk.viewer.entities.remove(this.nodePoints[i])
|
this.sdk.viewer.entities.remove(this.nodePoints[i])
|
||||||
}
|
}
|
||||||
@ -2695,6 +2706,12 @@ class CurvelineObject extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closeNodeEdit() {
|
closeNodeEdit() {
|
||||||
|
let _lastHeightMode = this._lastHeightMode
|
||||||
|
this._lastHeightMode = null
|
||||||
|
if(_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||||
|
this.heightMode = _lastHeightMode
|
||||||
|
}
|
||||||
|
YJ.Measure.SetMeasureStatus(false)
|
||||||
this.ControllerObject && this.ControllerObject.destroy()
|
this.ControllerObject && this.ControllerObject.destroy()
|
||||||
this.event && this.event.destroy()
|
this.event && this.event.destroy()
|
||||||
this.tip && this.tip.destroy()
|
this.tip && this.tip.destroy()
|
||||||
|
|||||||
@ -1683,6 +1683,7 @@ class PolygonObject extends Base {
|
|||||||
_this.previous.positions[0],
|
_this.previous.positions[0],
|
||||||
_this.previous.positions[1]
|
_this.previous.positions[1]
|
||||||
]
|
]
|
||||||
|
this.previous = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2587,6 +2587,7 @@ class PolylineObject extends Base {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
nodeEdit(cb) {
|
nodeEdit(cb) {
|
||||||
|
let lastHeightMode = this.heightMode
|
||||||
this.positionEditing = false
|
this.positionEditing = false
|
||||||
this.noseToTail = false
|
this.noseToTail = false
|
||||||
// this.smooth = false
|
// this.smooth = false
|
||||||
@ -2594,6 +2595,7 @@ class PolylineObject extends Base {
|
|||||||
if (YJ.Measure.GetMeasureStatus()) {
|
if (YJ.Measure.GetMeasureStatus()) {
|
||||||
} else {
|
} else {
|
||||||
this.closeNodeEdit()
|
this.closeNodeEdit()
|
||||||
|
this._lastHeightMode = lastHeightMode
|
||||||
YJ.Measure.SetMeasureStatus(true)
|
YJ.Measure.SetMeasureStatus(true)
|
||||||
this._nodeEditCallback = cb
|
this._nodeEditCallback = cb
|
||||||
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
|
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
|
||||||
@ -2644,6 +2646,11 @@ class PolylineObject extends Base {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.event.mouse_right((movement, cartesian) => {
|
this.event.mouse_right((movement, cartesian) => {
|
||||||
|
let _lastHeightMode = this._lastHeightMode
|
||||||
|
this._lastHeightMode = null
|
||||||
|
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||||
|
this.heightMode = _lastHeightMode
|
||||||
|
}
|
||||||
for (let i = 0; i < this.nodePoints.length; i++) {
|
for (let i = 0; i < this.nodePoints.length; i++) {
|
||||||
this.sdk.viewer.entities.remove(this.nodePoints[i])
|
this.sdk.viewer.entities.remove(this.nodePoints[i])
|
||||||
}
|
}
|
||||||
@ -2696,6 +2703,11 @@ class PolylineObject extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closeNodeEdit() {
|
closeNodeEdit() {
|
||||||
|
let _lastHeightMode = this._lastHeightMode
|
||||||
|
this._lastHeightMode = null
|
||||||
|
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||||
|
this.heightMode = _lastHeightMode
|
||||||
|
}
|
||||||
YJ.Measure.SetMeasureStatus(false)
|
YJ.Measure.SetMeasureStatus(false)
|
||||||
this.ControllerObject && this.ControllerObject.destroy()
|
this.ControllerObject && this.ControllerObject.destroy()
|
||||||
this.event && this.event.destroy()
|
this.event && this.event.destroy()
|
||||||
@ -2846,8 +2858,8 @@ class PolylineObject extends Base {
|
|||||||
this.previous.positions = positionsLngLat
|
this.previous.positions = positionsLngLat
|
||||||
|
|
||||||
// this.entity.polyline.positionsLngLat = positionsLngLat
|
// this.entity.polyline.positionsLngLat = positionsLngLat
|
||||||
let fromDegreesArray = this.renewPositions(this.options.positions, ()=>{
|
let fromDegreesArray = this.renewPositions(this.options.positions, () => {
|
||||||
if(this._positionEditingCallback) {
|
if (this._positionEditingCallback) {
|
||||||
this._positionEditingCallback()
|
this._positionEditingCallback()
|
||||||
this._positionEditingCallback = null
|
this._positionEditingCallback = null
|
||||||
}
|
}
|
||||||
@ -2958,7 +2970,7 @@ class PolylineObject extends Base {
|
|||||||
return this._lengthChangeCallBack
|
return this._lengthChangeCallBack
|
||||||
}
|
}
|
||||||
|
|
||||||
set lengthChangeCallBack (cd) {
|
set lengthChangeCallBack(cd) {
|
||||||
this._lengthChangeCallBack = cd
|
this._lengthChangeCallBack = cd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1440,6 +1440,10 @@ class SectorObject extends Base {
|
|||||||
center: this.deepCopyObj(this.options.center)
|
center: this.deepCopyObj(this.options.center)
|
||||||
}
|
}
|
||||||
this.positionEditing = false
|
this.positionEditing = false
|
||||||
|
if(this._positionEditingCallback) {
|
||||||
|
this._positionEditingCallback()
|
||||||
|
this._positionEditingCallback = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.event.mouse_right((movement, cartesian) => {
|
this.event.mouse_right((movement, cartesian) => {
|
||||||
this.positionEditing = false
|
this.positionEditing = false
|
||||||
@ -1520,7 +1524,8 @@ class SectorObject extends Base {
|
|||||||
this._areaChangeCallBack = cd
|
this._areaChangeCallBack = cd
|
||||||
}
|
}
|
||||||
|
|
||||||
static nodeEdit(that, cb = () => { }) {
|
nodeEdit(cb = () => { }) {
|
||||||
|
let that = this
|
||||||
that.positionEditing = false
|
that.positionEditing = false
|
||||||
if (YJ.Measure.GetMeasureStatus()) {
|
if (YJ.Measure.GetMeasureStatus()) {
|
||||||
} else {
|
} else {
|
||||||
@ -1675,6 +1680,8 @@ class SectorObject extends Base {
|
|||||||
that.tip = null
|
that.tip = null
|
||||||
|
|
||||||
that.heightMode = that.heightMode
|
that.heightMode = that.heightMode
|
||||||
|
|
||||||
|
cb('', {...that.options.center})
|
||||||
})
|
})
|
||||||
}, 200);
|
}, 200);
|
||||||
async function createNodePoints(pos, type) {
|
async function createNodePoints(pos, type) {
|
||||||
|
|||||||
@ -95,6 +95,7 @@ class TrajectoryMotion extends Base {
|
|||||||
this.options.line.noseToTail = options.line.noseToTail ? options.line.noseToTail : false
|
this.options.line.noseToTail = options.line.noseToTail ? options.line.noseToTail : false
|
||||||
this.positions_smooth = []
|
this.positions_smooth = []
|
||||||
this.options.ground = options.ground || false
|
this.options.ground = options.ground || false
|
||||||
|
this.options.reverse = options.reverse || false
|
||||||
this.options.state = (options.state || options.state === false) ? options.state : true
|
this.options.state = (options.state || options.state === false) ? options.state : true
|
||||||
this.options.routeDirection = (options.routeDirection || options.routeDirection === false) ? options.routeDirection : true
|
this.options.routeDirection = (options.routeDirection || options.routeDirection === false) ? options.routeDirection : true
|
||||||
this.keyPoints = []
|
this.keyPoints = []
|
||||||
@ -618,13 +619,23 @@ class TrajectoryMotion extends Base {
|
|||||||
set delay(v) {
|
set delay(v) {
|
||||||
this.options.delay = v
|
this.options.delay = v
|
||||||
if (this.TweenAnimate && this.TweenAnimate._isPlaying) {
|
if (this.TweenAnimate && this.TweenAnimate._isPlaying) {
|
||||||
this.TweenAnimate.delay(this.delay)
|
this.TweenAnimate.delay(this.delay*1000)
|
||||||
}
|
}
|
||||||
this._elms.delay && this._elms.delay.forEach((item) => {
|
this._elms.delay && this._elms.delay.forEach((item) => {
|
||||||
item.value = v
|
item.value = v
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get reverse() {
|
||||||
|
return this.options.reverse
|
||||||
|
}
|
||||||
|
|
||||||
|
set reverse(v) {
|
||||||
|
this.lineEdit = false
|
||||||
|
this.options.reverse = v
|
||||||
|
this.smooth = this.smooth
|
||||||
|
}
|
||||||
|
|
||||||
get state() {
|
get state() {
|
||||||
return this.options.state
|
return this.options.state
|
||||||
}
|
}
|
||||||
@ -646,10 +657,10 @@ class TrajectoryMotion extends Base {
|
|||||||
if (this.TweenAnimate.isPlaying()) {
|
if (this.TweenAnimate.isPlaying()) {
|
||||||
this.TweenAnimate.timeout = setTimeout(() => {
|
this.TweenAnimate.timeout = setTimeout(() => {
|
||||||
this.TweenAnimate.resume()
|
this.TweenAnimate.resume()
|
||||||
}, this.options.delay);
|
}, this.options.delay*1000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.TweenAnimate.delay(this.delay).start()
|
this.TweenAnimate.delay(this.delay*1000).start()
|
||||||
}
|
}
|
||||||
this.speed = this.speed
|
this.speed = this.speed
|
||||||
}
|
}
|
||||||
@ -1513,7 +1524,7 @@ class TrajectoryMotion extends Base {
|
|||||||
let HeadingPitchRoll2
|
let HeadingPitchRoll2
|
||||||
let previous = {}
|
let previous = {}
|
||||||
let m = 0
|
let m = 0
|
||||||
this.TweenAnimate = new TWEEN.Tween({ distance: startDistance }).to({ distance: this.distance }, (totalTime - time) * 1000).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop ? Infinity : 0).onRepeat(() => {
|
this.TweenAnimate = new TWEEN.Tween({ distance: startDistance }).to({ distance: this.distance }, (totalTime - time) * 1000).delay(this.delay*1000).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop ? Infinity : 0).onRepeat(() => {
|
||||||
if (time || startDistance) {
|
if (time || startDistance) {
|
||||||
this.modelMove(positions)
|
this.modelMove(positions)
|
||||||
}
|
}
|
||||||
@ -2457,10 +2468,13 @@ class TrajectoryMotion extends Base {
|
|||||||
|
|
||||||
// 更新坐标
|
// 更新坐标
|
||||||
renewLinePositions(pos) {
|
renewLinePositions(pos) {
|
||||||
let positions = pos
|
let positions = [...pos]
|
||||||
if (this.noseToTail) {
|
if (this.noseToTail) {
|
||||||
positions = [...pos, pos[0]]
|
positions = [...pos, pos[0]]
|
||||||
}
|
}
|
||||||
|
if(this.reverse) {
|
||||||
|
positions.reverse()
|
||||||
|
}
|
||||||
let fromDegreesArrayHeights = []
|
let fromDegreesArrayHeights = []
|
||||||
let time = []
|
let time = []
|
||||||
let positions_smooth = []
|
let positions_smooth = []
|
||||||
|
|||||||
@ -1220,7 +1220,7 @@ class Tools {
|
|||||||
let pos3 = new Cesium.Cartesian3.fromDegrees(position.lng, position.lat);
|
let pos3 = new Cesium.Cartesian3.fromDegrees(position.lng, position.lat);
|
||||||
let position1
|
let position1
|
||||||
try {
|
try {
|
||||||
position1 = await this.sdk.viewer.scene.clampToHeight(pos3, objectsToExclude) || pos3
|
position1 = await this.sdk.viewer.scene.clampToHeight({x:pos3.x, y: pos3.y, z: pos3.z}, objectsToExclude) || pos3
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
position1 = pos3
|
position1 = pos3
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,10 @@
|
|||||||
--color-text-shadow: rgba(20, 118, 255, 1);
|
--color-text-shadow: rgba(20, 118, 255, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* .cesium-viewer.\32 d{
|
||||||
|
opacity: 0;
|
||||||
|
} */
|
||||||
|
|
||||||
.cesium-viewer-cesiumWidgetContainer {
|
.cesium-viewer-cesiumWidgetContainer {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -171,9 +175,14 @@
|
|||||||
|
|
||||||
.YJ-custom-base-dialog button:not(button[disabled]):hover {
|
.YJ-custom-base-dialog button:not(button[disabled]):hover {
|
||||||
border-color: rgba(var(--color-base1), 1) !important;
|
border-color: rgba(var(--color-base1), 1) !important;
|
||||||
|
color: rgba(var(--color-base1), 1) !important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog button:not(button[disabled]):hover svg {
|
||||||
|
fill: rgba(var(--color-base1), 1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.YJ-custom-base-dialog button:focus-visible {
|
.YJ-custom-base-dialog button:focus-visible {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
@ -473,6 +482,9 @@
|
|||||||
.YJ-custom-base-dialog>.content .table .table-body .tr:first-child {
|
.YJ-custom-base-dialog>.content .table .table-body .tr:first-child {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
}
|
}
|
||||||
|
.YJ-custom-base-dialog>.content .table .table-body .tr:last-child {
|
||||||
|
border-bottom: 1px solid rgba(var(--color-base1), 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
.YJ-custom-base-dialog>.content .table .table-empty {
|
.YJ-custom-base-dialog>.content .table .table-empty {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -1772,7 +1784,7 @@
|
|||||||
|
|
||||||
/* 轨迹运动 */
|
/* 轨迹运动 */
|
||||||
.YJ-custom-base-dialog.trajectory-motion>.content {
|
.YJ-custom-base-dialog.trajectory-motion>.content {
|
||||||
width: 550px;
|
width: 562px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.YJ-custom-base-dialog.trajectory-motion>.content .div-item>.row>.col {
|
.YJ-custom-base-dialog.trajectory-motion>.content .div-item>.row>.col {
|
||||||
@ -1801,6 +1813,10 @@
|
|||||||
|
|
||||||
.YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active {
|
.YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active {
|
||||||
border-color: rgba(var(--color-base1));
|
border-color: rgba(var(--color-base1));
|
||||||
|
color: rgba(var(--color-base1));
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active svg {
|
||||||
|
fill: rgba(var(--color-base1));
|
||||||
}
|
}
|
||||||
|
|
||||||
.YJ-custom-base-dialog.trajectory-motion>.content .btn-group .btn.is-active>span {
|
.YJ-custom-base-dialog.trajectory-motion>.content .btn-group .btn.is-active>span {
|
||||||
@ -1826,7 +1842,6 @@
|
|||||||
.YJ-custom-base-dialog.trajectory-motion>.content .icon-rubric {
|
.YJ-custom-base-dialog.trajectory-motion>.content .icon-rubric {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
margin-left: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.YJ-custom-base-dialog.trajectory-motion>.content .custom__popper__arrow::after {
|
.YJ-custom-base-dialog.trajectory-motion>.content .custom__popper__arrow::after {
|
||||||
|
|||||||
Reference in New Issue
Block a user