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
path: root/map
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
parent6fa1a4fca3fb041fb6e2a91d28b649dadc2e372e (diff)
Added route clipping in following mode
Diffstat (limited to 'map')
-rw-r--r--map/framework.cpp8
-rw-r--r--map/framework.hpp3
2 files changed, 8 insertions, 3 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)
diff --git a/map/framework.hpp b/map/framework.hpp
index 5298a68d47..2f97150a4f 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -595,7 +595,8 @@ private:
void RemoveRoute();
void InsertRoute(routing::Route const & route);
void CheckLocationForRouting(location::GpsInfo const & info);
- void MatchLocationToRoute(location::GpsInfo & info, location::RouteMatchingInfo & routeMatchingInfo) const;
+ void MatchLocationToRoute(location::GpsInfo & info, location::RouteMatchingInfo & routeMatchingInfo,
+ bool & hasDistanceFromBegin, double & distanceFromBegin) const;
void CallRouteBuilded(routing::IRouter::ResultCode code,
vector<storage::TIndex> const & absentCountries,
vector<storage::TIndex> const & absentRoutingFiles);