diff --git a/iphone/Maps/Bookmarks/BalloonView.h b/iphone/Maps/Bookmarks/BalloonView.h index 8ad9748d1b..1fcc87a9a2 100644 --- a/iphone/Maps/Bookmarks/BalloonView.h +++ b/iphone/Maps/Bookmarks/BalloonView.h @@ -28,5 +28,7 @@ - (void) showInView:(UIView *)view atPoint:(CGPoint)pt; - (void) updatePosition:(UIView *)view atPoint:(CGPoint)pt; - (void) hide; +// Update baloon image with new title +- (void) updateTitle:(NSString *)newTitle; @end diff --git a/iphone/Maps/Bookmarks/BalloonView.mm b/iphone/Maps/Bookmarks/BalloonView.mm index 4af07b5be4..2d3a3df536 100644 --- a/iphone/Maps/Bookmarks/BalloonView.mm +++ b/iphone/Maps/Bookmarks/BalloonView.mm @@ -185,4 +185,10 @@ self.pinImage.image = [UIImage imageNamed:newColor]; } +- (void) updateTitle:(NSString *)newTitle +{ + if (m_titleView != nil) + m_titleView.image = [self createPopupImageWithName:newTitle andAddress:description]; +} + @end diff --git a/iphone/Maps/Bookmarks/PlacePageVC.mm b/iphone/Maps/Bookmarks/PlacePageVC.mm index 085c08902f..32b60e0aa6 100644 --- a/iphone/Maps/Bookmarks/PlacePageVC.mm +++ b/iphone/Maps/Bookmarks/PlacePageVC.mm @@ -73,7 +73,7 @@ { if (section != 0) return 0; - return 40; + return 60; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath @@ -208,6 +208,18 @@ - (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; + if (m_balloon.title != textField.text) + { + if (textField.text.length == 0) + { + m_balloon.title = NSLocalizedString(@"dropped_pin", @"Unknown Dropped Pin title, when name can't be determined"); + textField.text = m_balloon.title; + } + else + m_balloon.title = textField.text; + self.navigationController.title = m_balloon.title; + [m_balloon updateTitle:m_balloon.title]; + } return NO; } @end diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index bfaff9c996..a3deedf572 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -156,6 +156,8 @@ // Already added bookmark was clicked m2::PointD const globalPos = bm->GetOrg(); m_bookmark.globalPosition = CGPointMake(globalPos.x, globalPos.y); + // Override bookmark name which was set automatically according to the point address in previous line + m_bookmark.title = [NSString stringWithUTF8String:bm->GetName().c_str()]; [m_bookmark showInView:self.view atPoint:[self globalPoint2ViewPoint:m_bookmark.globalPosition]]; } }