diff --git a/map/routing_manager.cpp b/map/routing_manager.cpp index 7eec516e28..def20a7e14 100644 --- a/map/routing_manager.cpp +++ b/map/routing_manager.cpp @@ -156,14 +156,17 @@ void RoutingManager::SetRouterImpl(routing::RouterType type) return m_callbacks.m_countryInfoGetter().GetRegionCountryId(p); }; + auto numMwmIds = make_shared(); + m_delegate.RegisterCountryFilesOnRoute(numMwmIds); + if (type == RouterType::Pedestrian) { - router = CreatePedestrianAStarBidirectionalRouter(indexGetterFn(), countryFileGetter); + router = CreatePedestrianAStarBidirectionalRouter(indexGetterFn(), countryFileGetter, numMwmIds); m_routingSession.SetRoutingSettings(routing::GetPedestrianRoutingSettings()); } else if (type == RouterType::Bicycle) { - router = CreateBicycleAStarBidirectionalRouter(indexGetterFn(), countryFileGetter); + router = CreateBicycleAStarBidirectionalRouter(indexGetterFn(), countryFileGetter, numMwmIds); m_routingSession.SetRoutingSettings(routing::GetBicycleRoutingSettings()); } else @@ -179,10 +182,6 @@ void RoutingManager::SetRouterImpl(routing::RouterType type) return version::MwmTraits(mwmId.GetInfo()->m_version).HasRoutingIndex(); }; - auto numMwmIds = make_shared(); - - m_delegate.RegisterCountryFilesOnRoute(numMwmIds); - auto const getMwmRectByName = [this](std::string const & countryId) -> m2::RectD { return m_callbacks.m_countryInfoGetter().GetLimitRectForLeaf(countryId); }; diff --git a/map/routing_manager.hpp b/map/routing_manager.hpp index 1a0418d733..fbb5593c12 100644 --- a/map/routing_manager.hpp +++ b/map/routing_manager.hpp @@ -28,7 +28,6 @@ class DrapeEngine; namespace storage { class CountryInfoGetter; -class Storage; } namespace routing