diff --git a/map/routing_manager.cpp b/map/routing_manager.cpp index 1c605d532d..240cd9103e 100644 --- a/map/routing_manager.cpp +++ b/map/routing_manager.cpp @@ -1028,8 +1028,8 @@ void RoutingManager::BuildRoute(uint32_t timeoutSec) void RoutingManager::SetUserCurrentPosition(m2::PointD const & position) { - // @TODO(bykoianko) PositionAccumulator should be filled even if there's no route. - // That means IsRoutingActive() returns false. + m_routingSession.PushPositionAccumulator(position); + if (IsRoutingActive()) m_routingSession.SetUserCurrentPosition(position); diff --git a/routing/routing_session.cpp b/routing/routing_session.cpp index e5f355bab7..9a547d20a5 100644 --- a/routing/routing_session.cpp +++ b/routing/routing_session.cpp @@ -610,9 +610,20 @@ void RoutingSession::SetUserCurrentPosition(m2::PointD const & position) m_userCurrentPosition = position; m_userCurrentPositionValid = true; +} + +void RoutingSession::PushPositionAccumulator(m2::PointD const & position) +{ + CHECK_THREAD_CHECKER(m_threadChecker, ()); m_positionAccumulator.PushNextPoint(position); } +void RoutingSession::ClearPositionAccumulator() +{ + CHECK_THREAD_CHECKER(m_threadChecker, ()); + + m_positionAccumulator.Clear(); +} void RoutingSession::EnableTurnNotifications(bool enable) { diff --git a/routing/routing_session.hpp b/routing/routing_session.hpp index cb4fcfafea..af01c2ef3b 100644 --- a/routing/routing_session.hpp +++ b/routing/routing_session.hpp @@ -106,7 +106,8 @@ public: void SetUserCurrentPosition(m2::PointD const & position); - void ClearPositionAccumulator() { m_positionAccumulator.Clear(); } + void PushPositionAccumulator(m2::PointD const & position); + void ClearPositionAccumulator(); void ActivateAdditionalFeatures() {}