diff --git a/iphone/Maps/Classes/Common.h b/iphone/Maps/Classes/Common.h index 3975782973..742ee4d89c 100644 --- a/iphone/Maps/Classes/Common.h +++ b/iphone/Maps/Classes/Common.h @@ -6,5 +6,4 @@ #define BOOKMARK_CATEGORY_DELETED_NOTIFICATION @"BookmarkCategoryDeletedNotification" #define METRICS_CHANGED_NOTIFICATION @"MetricsChangedNotification" -#define BOOKMARK_DELETED_NOTIFICATION @"BookmarkDeletedNotification" -#define LOCATION_MANAGER_STARTED_NOTIFICATION @"LocationManagerStartedNotification" \ No newline at end of file +#define BOOKMARK_DELETED_NOTIFICATION @"BookmarkDeletedNotification" \ No newline at end of file diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 239f220562..a01255ccb1 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -175,7 +175,6 @@ const long long LITE_IDL = 431183278L; [[MapsAppDelegate theApp] disableStandby]; [[MapsAppDelegate theApp].m_locationManager start:self]; - [[NSNotificationCenter defaultCenter] postNotificationName:LOCATION_MANAGER_STARTED_NOTIFICATION object:nil]; return; } diff --git a/iphone/Maps/Classes/PlacePageInfoCell.mm b/iphone/Maps/Classes/PlacePageInfoCell.mm index 16f4ed20ed..de2e45d66e 100644 --- a/iphone/Maps/Classes/PlacePageInfoCell.mm +++ b/iphone/Maps/Classes/PlacePageInfoCell.mm @@ -30,6 +30,7 @@ { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; self.selectionStyle = UITableViewCellSelectionStyleNone; + self.backgroundColor = [UIColor clearColor]; [self addSubview:self.compassView]; [self addSubview:self.distanceLabel]; diff --git a/iphone/Maps/Classes/PlacePageView.mm b/iphone/Maps/Classes/PlacePageView.mm index a2c477e707..3cecbdd6b1 100644 --- a/iphone/Maps/Classes/PlacePageView.mm +++ b/iphone/Maps/Classes/PlacePageView.mm @@ -94,16 +94,9 @@ typedef NS_ENUM(NSUInteger, CellRow) updatingTable = NO; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startMonitoringLocation:) name:LOCATION_MANAGER_STARTED_NOTIFICATION object:nil]; - return self; } -- (void)startMonitoringLocation:(NSNotification *)notification -{ - [[MapsAppDelegate theApp].m_locationManager start:self]; -} - - (void)onLocationError:(location::TLocationError)errorCode { NSLog(@"Location error %i in %@", errorCode, [[self class] className]); @@ -284,6 +277,15 @@ typedef NS_ENUM(NSUInteger, CellRow) [self alignAnimated:animated]; self.tableView.contentInset = UIEdgeInsetsMake([self headerHeight], 0, 0, 0); [self.tableView setContentOffset:CGPointMake(0, -self.tableView.contentInset.top) animated:animated]; + if (state == PlacePageStateOpened) + { + if ([[MapsAppDelegate theApp].m_locationManager enabledOnMap]) + [[MapsAppDelegate theApp].m_locationManager start:self]; + } + else + { + [[MapsAppDelegate theApp].m_locationManager stop:self]; + } } - (void)layoutSubviews @@ -709,18 +711,7 @@ typedef NS_ENUM(NSUInteger, CellRow) - (NSString *)types { if (!_types) - { - if ([self isBookmark]) - { - search::AddressInfo addressInfo; - GetFramework().GetAddressInfoForGlobalPoint([self userMark]->GetOrg(), addressInfo); - _types = [NSString stringWithUTF8String:addressInfo.GetPinType().c_str()]; - } - else - { - _types = [NSString stringWithUTF8String:[self addressInfo].GetPinType().c_str()]; - } - } + _types = [NSString stringWithUTF8String:[self addressInfo].GetPinType().c_str()]; return _types; }