Skip to content

Commit

Permalink
cesium: fix bad mode color coding
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Sep 8, 2023
1 parent bb1c807 commit b13ce9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/cesiumExtra/colorCoderMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ export default class ColorCoderMode {
}

getMode (time) {
let previousMode = this.state.flightModeChanges[0][1]
for (const mode of this.state.flightModeChanges) {
if (mode[0] > time) {
return mode[1]
return previousMode
}
previousMode = mode[1]
}
return this.state.flightModeChanges[this.state.flightModeChanges.length - 1][1]
}
Expand Down

0 comments on commit b13ce9e

Please sign in to comment.