Signed-off-by: Anton Makouski <anton.makouski@gmail.com>
This commit is contained in:
Anton Makouski 2022-08-16 11:42:38 +03:00 committed by Viktor Govako
parent d151641ee2
commit 60bca55eaa

View file

@ -161,11 +161,14 @@ final class NavigationControlView: SolidTouchView, MWMTextToSpeechObserver, MapO
}
let speedMeasure = Measure(asSpeed: speedMps)
var speed = speedMeasure.valueAsString;
/// @todo Draw speed limit sign similar to the CarPlay implemenation.
// speedLimitMps >= 0 means known limited speed.
if (info.speedLimitMps >= 0) {
// Short delimeter to not overlap with timeToTarget longer than an hour.
let delimeter = info.timeToTarget < 60 * 60 ? " / " : "/"
let speedLimitMeasure = Measure(asSpeed: info.speedLimitMps)
// speedLimitMps == 0 means unlimited speed.
speed += " / " + (info.speedLimitMps == 0 ? "" : speedLimitMeasure.valueAsString);
speed += delimeter + (info.speedLimitMps == 0 ? "" : speedLimitMeasure.valueAsString)
}
speedLabel.text = speed