From 39c251c9bf64d0a38e3835a373c1db80b6741635 Mon Sep 17 00:00:00 2001 From: Igor Khmurets Date: Fri, 5 Sep 2014 18:08:38 +0300 Subject: [PATCH] [ios] Do not show PP compass on devices without it --- iphone/Maps/Classes/PlacePageInfoCell.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Classes/PlacePageInfoCell.mm b/iphone/Maps/Classes/PlacePageInfoCell.mm index 4ceb2ad412..16d0c244b8 100644 --- a/iphone/Maps/Classes/PlacePageInfoCell.mm +++ b/iphone/Maps/Classes/PlacePageInfoCell.mm @@ -115,8 +115,9 @@ BOOL const shouldShowLocationViews = [[MapsAppDelegate theApp].m_locationManager enabledOnMap] && !self.myPositionMode; if (shouldShowLocationViews) { - self.compassView.origin = CGPointMake(15, 12.5); - self.compassView.hidden = NO; + BOOL const headingAvailable = [CLLocationManager headingAvailable]; + self.compassView.origin = CGPointMake(15 - (headingAvailable ? 0 : self.compassView.width + 17), 12.5); + self.compassView.hidden = !headingAvailable; CGFloat const width = 134; self.distanceLabel.frame = CGRectMake(self.compassView.maxX + 15, 13, width, 20);