Switch primary and secondary turns if the secondary turn is the actual turn
This commit is contained in:
parent
ebb4d42f29
commit
24ab8baa10
1 changed files with 9 additions and 0 deletions
|
@ -831,6 +831,15 @@ public class RouteResultPreparation {
|
|||
derivedTurnType.setLanes(t.getLanes());
|
||||
derivedTurnType.setSkipToSpeak(t.isSkipToSpeak());
|
||||
t = derivedTurnType;
|
||||
|
||||
// Because only the primary turn is displayed, if the turn to be taken is currently set as the secondary turn, then that needs to be switched around.
|
||||
for (int i = 0; i < t.getLanes().length; i++) {
|
||||
if (TurnType.getSecondaryTurn(t.getLanes()[i]) == t.getValue()) {
|
||||
int temp = TurnType.getSecondaryTurn(t.getLanes()[i]);
|
||||
t.setSecondaryTurn(i, TurnType.getPrimaryTurn(t.getLanes()[i]));
|
||||
t.setPrimaryTurn(i, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return t;
|
||||
|
|
Loading…
Reference in a new issue