diff --git a/routing/route.cpp b/routing/route.cpp index 62b724a6e5..0e7a2ea429 100644 --- a/routing/route.cpp +++ b/routing/route.cpp @@ -201,14 +201,13 @@ void Route::MatchLocationToRoute(location::GpsInfo & location, location::RouteMa { if (m_current.IsValid()) { - m2::PointD const locationMerc(MercatorBounds::LonToX(location.m_longitude), - MercatorBounds::LatToY(location.m_latitude)); + m2::PointD const locationMerc = MercatorBounds::FromLatLon(location.m_latitude, location.m_longitude); double const distFromRouteM = MercatorBounds::DistanceOnEarth(m_current.m_pt, locationMerc); if (distFromRouteM < m_routingSettings.m_matchingThresholdM) { location.m_latitude = MercatorBounds::YToLat(m_current.m_pt.y); location.m_longitude = MercatorBounds::XToLon(m_current.m_pt.x); - if (m_routingSettings.m_matchBearing) + if (m_routingSettings.m_matchRoute) location.m_bearing = location::AngleToBearing(GetPolySegAngle(m_current.m_ind)); routeMatchingInfo.Set(m_current.m_pt, m_current.m_ind); diff --git a/routing/routing_settings.hpp b/routing/routing_settings.hpp index 1eb6ecdff5..efae323b27 100644 --- a/routing/routing_settings.hpp +++ b/routing/routing_settings.hpp @@ -10,11 +10,11 @@ namespace routing /// For example, route matching properties, rerouting properties and so on. struct RoutingSettings { - /// \brief if m_matchBearing is equal to true the bearing follows the + /// \brief if m_matchRoute is equal to true the bearing follows the /// route direction if the current position is matched to the route. - /// If m_matchBearing is equal to false GPS bearing is used while + /// If m_matchRoute is equal to false GPS bearing is used while /// the current position is matched to the route. - bool m_matchBearing; + bool m_matchRoute; /// \brief m_matchingThresholdM is half width of the passage around the route /// for route matching in meters. That means if a real current position is closer than @@ -25,11 +25,11 @@ struct RoutingSettings inline RoutingSettings GetPedestrianRoutingSettings() { - return RoutingSettings({ false /* m_matchBearing */, 20. /* m_matchingThresholdM */ }); + return RoutingSettings({ false /* m_matchRoute */, 20. /* m_matchingThresholdM */ }); } inline RoutingSettings GetCarRoutingSettings() { - return RoutingSettings({ true /* m_matchBearing */, 50. /* m_matchingThresholdM */ }); + return RoutingSettings({ true /* m_matchRoute */, 50. /* m_matchingThresholdM */ }); } } // namespace routing