Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2015-06-09 14:03:19 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:59:34 +0300
commit6b014d1414ab893e3934cb3d1a1296621ebc0ef4 (patch)
tree9d8e87dec442567e346eab52d3737cde842d40b4 /map/framework.cpp
parent6fa1a4fca3fb041fb6e2a91d28b649dadc2e372e (diff)
Added route clipping in following mode
Diffstat (limited to 'map/framework.cpp')
-rw-r--r--map/framework.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index ec47b32e3e..c2b5ea0e44 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -136,7 +136,9 @@ void Framework::OnLocationUpdate(GpsInfo const & info)
#endif
location::RouteMatchingInfo routeMatchingInfo;
CheckLocationForRouting(rInfo);
- MatchLocationToRoute(rInfo, routeMatchingInfo);
+ bool hasDistanceFromBegin = false;
+ double distanceFromBegin = 0.0;
+ MatchLocationToRoute(rInfo, routeMatchingInfo, hasDistanceFromBegin, distanceFromBegin);
shared_ptr<State> const & state = GetLocationState();
state->OnLocationUpdate(rInfo, m_routingSession.IsNavigable(), routeMatchingInfo);
@@ -2268,11 +2270,13 @@ void Framework::CheckLocationForRouting(GpsInfo const & info)
}
}
-void Framework::MatchLocationToRoute(location::GpsInfo & location, location::RouteMatchingInfo & routeMatchingInfo) const
+void Framework::MatchLocationToRoute(location::GpsInfo & location, location::RouteMatchingInfo & routeMatchingInfo,
+ bool & hasDistanceFromBegin, double & distanceFromBegin) const
{
if (!IsRoutingActive())
return;
m_routingSession.MatchLocationToRoute(location, routeMatchingInfo);
+ hasDistanceFromBegin = m_routingSession.GetMercatorDistanceFromBegin(distanceFromBegin);
}
void Framework::CallRouteBuilded(IRouter::ResultCode code, vector<storage::TIndex> const & absentCountries, vector<storage::TIndex> const & absentRoutingFiles)