diff --git a/iphone/Maps/Classes/Routing/MWMRouter.mm b/iphone/Maps/Classes/Routing/MWMRouter.mm index 1ccf737af3..3ea56d56ac 100644 --- a/iphone/Maps/Classes/Routing/MWMRouter.mm +++ b/iphone/Maps/Classes/Routing/MWMRouter.mm @@ -117,8 +117,6 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi { self.startPoint = startPoint; [self rebuildWithBestRouter:bestRouter]; - if (!self.finishPoint.IsValid()) - [[MWMMapViewControlsManager manager] onRoutePrepare]; } - (void)buildToPoint:(MWMRoutePoint const &)finishPoint bestRouter:(BOOL)bestRouter @@ -185,6 +183,8 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi setTags(self.type, YES); } + MWMMapViewControlsManager * mapViewControlsManager = [MWMMapViewControlsManager manager]; + [mapViewControlsManager onRoutePrepare]; if (![self arePointsValidForRouting]) return; auto & f = GetFramework(); @@ -195,7 +195,7 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi f.BuildRoute(startPoint, finishPoint, 0 /* timeoutSec */); f.SetRouteStartPoint(startPoint, isMarkerPoint(self.startPoint)); f.SetRouteFinishPoint(finishPoint, isMarkerPoint(self.finishPoint)); - [[MWMMapViewControlsManager manager] onRouteRebuild]; + [mapViewControlsManager onRouteRebuild]; setTags(self.type, NO); } @@ -368,6 +368,7 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi countries:(storage::TCountriesVec const &)absentCountries { MWMRouterSavedState * state = [MWMRouterSavedState state]; + MWMMapViewControlsManager * mapViewControlsManager = [MWMMapViewControlsManager manager]; switch (code) { case routing::IRouter::ResultCode::NoError: @@ -377,12 +378,12 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi if (state.forceStateChange == MWMRouterForceStateChange::Start) [self start]; else - [[MWMMapViewControlsManager manager] onRouteReady]; + [mapViewControlsManager onRouteReady]; [self updateFollowingInfo]; if (![MWMRouter isTaxi]) [[MWMNavigationDashboardManager manager] setRouteBuilderProgress:100]; - [MWMMapViewControlsManager manager].searchHidden = YES; + mapViewControlsManager.searchHidden = YES; break; } case routing::IRouter::RouteFileNotExist: @@ -391,7 +392,7 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi case routing::IRouter::FileTooOld: case routing::IRouter::RouteNotFound: [self presentDownloaderAlert:code countries:absentCountries]; - [[MWMMapViewControlsManager manager] onRouteError]; + [mapViewControlsManager onRouteError]; break; case routing::IRouter::Cancelled: break; case routing::IRouter::StartPointNotFound: @@ -400,7 +401,7 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi case routing::IRouter::PointsInDifferentMWM: case routing::IRouter::InternalError: [[MWMAlertViewController activeAlertController] presentAlert:code]; - [[MWMMapViewControlsManager manager] onRouteError]; + [mapViewControlsManager onRouteError]; break; } state.forceStateChange = MWMRouterForceStateChange::None;