diff --git a/iphone/Maps/Classes/PlacePageView.h b/iphone/Maps/Classes/PlacePageView.h index 20fc1a2d07..3d5b3a60dd 100644 --- a/iphone/Maps/Classes/PlacePageView.h +++ b/iphone/Maps/Classes/PlacePageView.h @@ -38,6 +38,6 @@ typedef NS_ENUM(NSUInteger, PlacePageState) { @property (nonatomic, readonly) NSString * temporaryTitle; @property (nonatomic) BOOL statusBarIncluded; -- (void)showBuildingRoutingActivity:(BOOL)buiding; +- (void)showBuildingRoutingActivity:(BOOL)show; @end diff --git a/iphone/Maps/Classes/PlacePageView.mm b/iphone/Maps/Classes/PlacePageView.mm index fc3eaa5bb5..7de9666bdf 100644 --- a/iphone/Maps/Classes/PlacePageView.mm +++ b/iphone/Maps/Classes/PlacePageView.mm @@ -364,7 +364,11 @@ typedef NS_ENUM(NSUInteger, CellRow) self.bookmarkButton.midY = 44; } self.routeButton.midY = self.bookmarkButton.midY - 1; - self.routeButton.hidden = [self isMyPosition]; + if (self.routingActivity.isAnimating) { + self.routeButton.hidden = YES; + } else { + self.routeButton.hidden = [self isMyPosition]; + } } - (CGFloat)headerHeight @@ -445,6 +449,9 @@ typedef NS_ENUM(NSUInteger, CellRow) CGFloat const headerHeight = [self headerHeight]; self.tableView.frame = CGRectMake(0, headerHeight, self.superview.width, self.backgroundView.height - headerHeight); } + if (self.routingActivity.isAnimating) { + self.routingActivity.center = CGPointMake(self.routeButton.midX, self.routeButton.midY + INTEGRAL(2.5)); + } } #define BOTTOM_SHADOW_OFFSET 18 @@ -811,11 +818,11 @@ typedef NS_ENUM(NSUInteger, CellRow) m_bookmarkData = NULL; } -- (void)showBuildingRoutingActivity:(BOOL)building +- (void)showBuildingRoutingActivity:(BOOL)show { - if (building) + self.routeButton.hidden = show; + if (show) { - self.routeButton.hidden = YES; self.routingActivity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; self.routingActivity.center = CGPointMake(self.routeButton.midX, self.routeButton.midY + INTEGRAL(2.5)); [self.routeButton.superview addSubview:self.routingActivity]; @@ -823,7 +830,7 @@ typedef NS_ENUM(NSUInteger, CellRow) } else { - self.routeButton.hidden = NO; + [self.routingActivity stopAnimating]; [self.routingActivity removeFromSuperview]; } }