diff options
author | Lev Dragunov <l.dragunov@corp.mail.ru> | 2015-07-27 17:13:07 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:58:36 +0300 |
commit | e1668eeda0dcfd9286cb2dd70eac455b69a89665 (patch) | |
tree | 763af15e179f7a735ebe6e878f3933d6ab4633a9 /map/framework.cpp | |
parent | 09cb4e5245e836fbf89169adf4f13c130a09a0ab (diff) |
Routing observer interface implementation.
Diffstat (limited to 'map/framework.cpp')
-rw-r--r-- | map/framework.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index d5d0c62b95..417d9f1720 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2142,19 +2142,6 @@ routing::RouterType Framework::GetRouter() const void Framework::SetRouterImpl(RouterType type) { -#ifdef DEBUG - TRoutingVisualizerFn const routingVisualizerFn = [this](m2::PointD const & pt) - { - GetPlatform().RunOnGuiThread([this,pt]() - { - m_bmManager.UserMarksGetController(UserMarkContainer::DEBUG_MARK).CreateUserMark(pt); - Invalidate(); - }); - }; -#else - TRoutingVisualizerFn const routingVisualizerFn = nullptr; -#endif - auto const routingStatisticsFn = [](map<string, string> const & statistics) { alohalytics::LogEvent("Routing_CalculatingRoute", statistics); @@ -2175,17 +2162,29 @@ void Framework::SetRouterImpl(RouterType type) unique_ptr<OnlineAbsentCountriesFetcher> fetcher; if (type == RouterType::Pedestrian) { - router = CreatePedestrianAStarBidirectionalRouter(m_model.GetIndex(), routingVisualizerFn); + router = CreatePedestrianAStarBidirectionalRouter(m_model.GetIndex()); m_routingSession.SetRoutingSettings(routing::GetPedestrianRoutingSettings()); } else { - router.reset(new OsrmRouter(&m_model.GetIndex(), countryFileGetter, routingVisualizerFn)); + router.reset(new OsrmRouter(&m_model.GetIndex(), countryFileGetter)); fetcher.reset(new OnlineAbsentCountriesFetcher(countryFileGetter, localFileGetter)); m_routingSession.SetRoutingSettings(routing::GetCarRoutingSettings()); } - m_routingSession.SetRouter(move(router), move(fetcher), routingStatisticsFn); +#ifdef DEBUG + routing::TPointCheckCallback const routingVisualizerFn = [this](m2::PointD const & pt) + { + GetPlatform().RunOnGuiThread([this,pt]() + { + m_bmManager.UserMarksGetController(UserMarkContainer::DEBUG_MARK).CreateUserMark(pt); + Invalidate(); + }); + }; +#else + routing::TPointCheckCallback const routingVisualizerFn = nullptr; +#endif + m_routingSession.SetRouter(move(router), move(fetcher), routingStatisticsFn, routingVisualizerFn); m_currentRouterType = type; } |