[MAPSME-5513] [ios] Removed elevation for vehicle & taxi routings.

This commit is contained in:
Ilya Grechuhin 2017-09-14 15:42:25 +03:00 committed by Vlad Mihaylenko
parent e8e7ae3389
commit 87735e7050
2 changed files with 21 additions and 8 deletions

View file

@ -152,16 +152,19 @@ final class RoutePreviewStatus: SolidTouchView {
} else {
taxiBox.isHidden = true
resultsBox.isHidden = false
self.elevation = nil
if MWMRouter.hasRouteAltitude() {
heightBox.isHidden = false
MWMRouter.routeAltitudeImage(for: heightProfileImage.frame.size,
completion: { image, elevation in
self.heightProfileImage.image = image
if let elevation = elevation {
let attributes: [String : Any] = [NSForegroundColorAttributeName : UIColor.linkBlue(),
NSFontAttributeName : UIFont.medium14()]
self.elevation = NSAttributedString(string: "▲▼ \(elevation)", attributes: attributes)
}
self.heightProfileImage.image = image
if let elevation = elevation {
let attributes: [String: Any] = [
NSForegroundColorAttributeName: UIColor.linkBlue(),
NSFontAttributeName: UIFont.medium14(),
]
self.elevation = NSAttributedString(string: "▲▼ \(elevation)", attributes: attributes)
}
})
} else {
heightBox.isHidden = true
@ -186,7 +189,7 @@ final class RoutePreviewStatus: SolidTouchView {
}
return result.copy() as? NSAttributedString
},
iPad: { info.estimate })()
iPad: { info.estimate })()
}
func onNavigationInfoUpdated(_ info: MWMNavigationDashboardEntity) {

View file

@ -83,7 +83,17 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType)
return router;
}
+ (BOOL)hasRouteAltitude { return GetFramework().GetRoutingManager().HasRouteAltitude(); }
+ (BOOL)hasRouteAltitude
{
switch ([self type])
{
case MWMRouterTypeVehicle:
case MWMRouterTypeTaxi: return NO;
case MWMRouterTypePedestrian:
case MWMRouterTypeBicycle: return GetFramework().GetRoutingManager().HasRouteAltitude();
}
}
+ (BOOL)isTaxi
{
return GetFramework().GetRoutingManager().GetRouter() == routing::RouterType::Taxi;