[ios] Automatically add bookmark pin on opened geo:// url scheme

This commit is contained in:
Alex Zolotarev 2013-01-14 16:34:42 +03:00 committed by Alex Zolotarev
parent c73841b9f4
commit 2c7001741a
2 changed files with 9 additions and 1 deletions

View file

@ -20,6 +20,9 @@ void InitLocalizedStrings()
f.AddString("country_status_download", [NSLocalizedString(@"country_status_download", @"Button text for the button at the center of the screen when the country is not downloaded") UTF8String]);
f.AddString("country_status_download_failed", [NSLocalizedString(@"country_status_download_failed", @"Message to display at the center of the screen when the country download has failed") UTF8String]);
f.AddString("try_again", [NSLocalizedString(@"try_again", @"Button text for the button under the country_status_download_failed message") UTF8String]);
// Default texts for bookmarks added in C++ code (by URL Scheme API)
f.AddString("dropped_pin", [NSLocalizedString(@"dropped_pin", nil) UTF8String]);
f.AddString("my_places", [NSLocalizedString(@"my_places", nil) UTF8String]);
}
@implementation MapsAppDelegate

View file

@ -201,6 +201,9 @@ Framework::Framework()
m_stringsBundle.SetDefaultString("try_again", "Try Again");
m_stringsBundle.SetDefaultString("not_enough_free_space_on_sdcard", "Not enough space for downloading");
m_stringsBundle.SetDefaultString("dropped_pin", "Dropped Pin");
m_stringsBundle.SetDefaultString("my_places", "My Places");
m_animController.reset(new anim::Controller());
// Init GUI controller.
@ -1461,7 +1464,9 @@ bool Framework::SetViewportByURL(string const & url)
if (info.IsValid())
{
ShowRectEx(info.GetViewport());
ShowRectExVisibleScale(info.GetViewport());
Bookmark bm(info.GetMercatorPoint(), m_stringsBundle.GetString("dropped_pin"), DEFAULT_BOOKMARK_TYPE);
AddBookmark(m_stringsBundle.GetString("my_places"), bm);
Invalidate();
return true;
}