From 34825f5334cdb4abf673729c0dbf11257456b9e6 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Fri, 27 Nov 2015 13:19:25 +0300 Subject: [PATCH] Routing following info fix. --- platform/location.hpp | 1 + routing/routing_session.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/location.hpp b/platform/location.hpp index 6132896dd0..d57dbd083b 100644 --- a/platform/location.hpp +++ b/platform/location.hpp @@ -98,6 +98,7 @@ namespace location public: FollowingInfo() : m_turn(routing::turns::TurnDirection::NoTurn), + m_nextTurn(routing::turns::TurnDirection::NoTurn), m_exitNum(0), m_time(0), m_completionPercent(0), diff --git a/routing/routing_session.cpp b/routing/routing_session.cpp index 85ea2d175e..d4222444bc 100644 --- a/routing/routing_session.cpp +++ b/routing/routing_session.cpp @@ -241,13 +241,20 @@ void RoutingSession::GetRouteFollowingInfo(FollowingInfo & info) const threads::MutexGuard guard(m_routeSessionMutex); UNUSED_VALUE(guard); - if (!m_route.IsValid() || !IsNavigable()) + if (!m_route.IsValid()) { // nothing should be displayed on the screen about turns if these lines are executed info = FollowingInfo(); return; } + if (!IsNavigable()) + { + info = FollowingInfo(); + formatDistFn(m_route.GetTotalDistanceMeters(), info.m_distToTarget, info.m_targetUnitsSuffix); + return; + } + formatDistFn(m_route.GetCurrentDistanceToEndMeters(), info.m_distToTarget, info.m_targetUnitsSuffix); double distanceToTurnMeters = 0.;