diff --git a/src/components/cesiumExtra/colorCoderMode.js b/src/components/cesiumExtra/colorCoderMode.js index f84dbe5..f129386 100644 --- a/src/components/cesiumExtra/colorCoderMode.js +++ b/src/components/cesiumExtra/colorCoderMode.js @@ -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] }