Skip to content

Commit 51dd04c

Browse files
Cesium: fix some trajectories being squashed or underground
1 parent 8d8b196 commit 51dd04c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/CesiumViewer.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ export default {
228228
/*
229229
* Second step of setup, happens after the height of the starting point has been returned by Cesium
230230
* */
231-
this.heightOffset = updatedPositions[0].height
231+
this.heightOffset = 0
232+
for (let pos of updatedPositions) {
233+
this.heightOffset = Math.max(this.heightOffset, pos.height)
234+
}
232235
this.processTrajectory(this.state.current_trajectory)
233236
this.addModel()
234237
this.updateAndPlotTrajectory()
@@ -522,7 +525,7 @@ export default {
522525
position = Cartesian3.fromDegrees(
523526
pos[0],
524527
pos[1],
525-
Math.max(pos[2] + this.heightOffset, this.corrected_trajectory[posIndex].height)
528+
pos[2] + this.heightOffset
526529
)
527530
}
528531
this.positions.push(position)
@@ -645,7 +648,7 @@ export default {
645648
this.position = Cartesian3.fromDegrees(
646649
pos[0],
647650
pos[1],
648-
Math.max(pos[2] + this.heightOffset, this.heightOffset)
651+
pos[2] + this.heightOffset
649652
)
650653
trajectory.push(this.position)
651654
let color = this.getModeColor(pos[3])

0 commit comments

Comments
 (0)