forked from organicmaps/organicmaps
[ios] Added flags to search results when radar mode is not enabled
This commit is contained in:
parent
8cd568ddf6
commit
a63b5b9443
2 changed files with 14 additions and 1 deletions
|
@ -433,6 +433,19 @@ static void OnSearchResultCallback(search::Results const & res, int queryId)
|
|||
cell.featureCountry.text = [NSString stringWithUTF8String:r.GetRegionString()];
|
||||
cell.featureType.text = [NSString stringWithUTF8String:r.GetFeatureType()];
|
||||
cell.featureDistance.text = [SearchVC formatDistance:r.GetDistanceFromCenter()];
|
||||
if (m_radarButton.isSelected)
|
||||
cell.accessoryView = nil;
|
||||
else
|
||||
{ // Show flags only when radar mode is disabled
|
||||
char const * flagCode = r.GetRegionFlag();
|
||||
if (flagCode)
|
||||
{
|
||||
UIImage * flagImage = [UIImage imageNamed:[NSString stringWithFormat:@"%s.png", flagCode]];
|
||||
UIImageView * imgView = [[UIImageView alloc] initWithImage:flagImage];
|
||||
cell.accessoryView = imgView;
|
||||
[imgView release];
|
||||
}
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
// String that is displayed in the GUI.
|
||||
char const * GetString() const { return m_str.c_str(); }
|
||||
char const * GetRegionString() const { return m_region.c_str(); }
|
||||
char const * GetRegionFlag() const { return m_flag.c_str(); }
|
||||
char const * GetRegionFlag() const { return m_flag.empty() ? 0 : m_flag.c_str(); }
|
||||
char const * GetFeatureType() const { return m_type.c_str(); }
|
||||
|
||||
// Type of the result.
|
||||
|
|
Loading…
Add table
Reference in a new issue