forked from organicmaps/organicmaps
[ios] Fixed «route to» with no current location. (#4576)
* [ios] Fixed «route to» with no current location. * [ios] Code cleanup.
This commit is contained in:
parent
16b10bb015
commit
9f0137188b
1 changed files with 8 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue