forked from organicmaps/organicmaps
[ios] Fixed category text click in the search
This commit is contained in:
parent
0bc18d44b0
commit
b9672a803f
3 changed files with 14 additions and 6 deletions
|
@ -163,10 +163,18 @@ static void OnSearchResultCallback(search::Result const & res, int queryId)
|
|||
{
|
||||
if (indexPath.row < m_results.size())
|
||||
{
|
||||
if (m_results[indexPath.row].GetResultType() == search::Result::RESULT_FEATURE)
|
||||
search::Result const & res = m_results[indexPath.row];
|
||||
switch(res.GetResultType())
|
||||
{
|
||||
g_showRectF(m_results[indexPath.row].GetFeatureRect());
|
||||
// Zoom to the feature
|
||||
case search::Result::RESULT_FEATURE:
|
||||
g_showRectF(res.GetFeatureRect());
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
break;
|
||||
|
||||
case search::Result::RESULT_SUGGESTION:
|
||||
[(UISearchBar *)self.navigationItem.titleView setText: [NSString stringWithFormat:@"%s ", res.GetSuggestionString()]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,10 +66,10 @@ double Result::GetDirectionFromCenter() const
|
|||
return m_directionFromCenter;
|
||||
}
|
||||
|
||||
string Result::GetSuggestionString() const
|
||||
char const * Result::GetSuggestionString() const
|
||||
{
|
||||
ASSERT_EQUAL(GetResultType(), RESULT_SUGGESTION, ());
|
||||
return m_suggestionStr;
|
||||
return m_suggestionStr.c_str();
|
||||
}
|
||||
|
||||
} // namespace search
|
||||
|
|
|
@ -40,8 +40,8 @@ public:
|
|||
// Direction from thethe center of the screen in radians, if GetResultType() == RESULT_FEATURE.
|
||||
double GetDirectionFromCenter() const;
|
||||
|
||||
// String writo in the search box.
|
||||
string GetSuggestionString() const;
|
||||
// String to write in the search box.
|
||||
char const * GetSuggestionString() const;
|
||||
|
||||
private:
|
||||
string m_str;
|
||||
|
|
Loading…
Add table
Reference in a new issue