iPhone uses set/get router functions

This commit is contained in:
Constantin Shalnev 2015-07-23 17:04:30 +03:00 committed by Alex Zolotarev
parent 51eb668201
commit 92863f7983
3 changed files with 5 additions and 5 deletions

View file

@ -42,7 +42,8 @@ static NSString * const kPlacePageActionBarNibName = @"PlacePageActionBar";
BOOL const isMyPosition = placePage.manager.entity.type == MWMPlacePageEntityTypeMyPosition;
bar.routeButton.hidden = isMyPosition;
bar.autoresizingMask = UIViewAutoresizingNone;
NSString * routeImageName = [MapsAppDelegate theApp].isPedestrianRoutingMode ? @"ic_route_walk" : @"ic_route";
BOOL const isPedestrian = GetFramework().GetRouter() == routing::RouterType::Pedestrian;
NSString * routeImageName = isPedestrian ? @"ic_route_walk" : @"ic_route";
[bar.routeButton setImage:[UIImage imageNamed:routeImageName] forState:UIControlStateNormal];
return bar;
}

View file

@ -20,7 +20,6 @@
@property (nonatomic, weak) IBOutlet MapViewController * m_mapViewController;
@property (nonatomic, readonly) LocationManager * m_locationManager;
@property (nonatomic) BOOL isPedestrianRoutingMode;
+ (MapsAppDelegate *)theApp;

View file

@ -402,10 +402,10 @@ static BOOL keyboardLoaded = NO;
if (!isPedestrian && !isVehicle)
return NO;
MapsAppDelegate * delegate = [MapsAppDelegate theApp];
delegate.isPedestrianRoutingMode = isPedestrian;
[self search:cmd];
GetFramework().SetRouter(isPedestrian ? routing::RouterType::Pedestrian : routing::RouterType::Vehicle);
[self searchBarDidPressCancelButton:nil];
return YES;
}