diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus.swift index 8a66a2f7f7..afce043145 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus.swift @@ -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) { diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index 3815e4c48c..3729025248 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -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;