diff --git a/map/routing_session.cpp b/map/routing_session.cpp index a53ac1c104..d0ccb572b4 100644 --- a/map/routing_session.cpp +++ b/map/routing_session.cpp @@ -91,9 +91,10 @@ RoutingSession::State RoutingSession::OnLocationPositionChanged(m2::PointD const } else { - // distance from the last known projection on route + // Distance from the last known projection on route + // (check if we are moving far from the last known projection). double const dist = m_route.GetCurrentSqDistance(position); - if (dist > m_lastDistance) + if (dist > m_lastDistance || my::AlmostEqual(dist, m_lastDistance, 1 << 16)) { ++m_moveAwayCounter; m_lastDistance = dist; diff --git a/routing/route.cpp b/routing/route.cpp index 2d6bf879f5..f860f55bca 100644 --- a/routing/route.cpp +++ b/routing/route.cpp @@ -79,7 +79,7 @@ bool Route::MoveIterator(location::GpsInfo const & info) const } m2::RectD const rect = MercatorBounds::MetresToXY( - info.m_latitude, info.m_longitude, + info.m_longitude, info.m_latitude, max(ON_ROAD_TOLERANCE_M, info.m_horizontalAccuracy)); IterT const res = FindProjection(rect, predictDistance);