[downloader] Add countryId in place page

This commit is contained in:
Sergey Yershov 2016-04-20 13:04:58 +03:00
parent c3d68e8e3c
commit 9111481456
2 changed files with 16 additions and 0 deletions

View file

@ -679,6 +679,18 @@ void Framework::FillFeatureInfo(FeatureID const & fid, place_page::Info & info)
FeatureType ft;
guard.GetFeatureByIndex(fid.m_index, ft);
FillInfoFromFeatureType(ft, info);
// Fill countryId for place page info
info.m_countryId = m_infoGetter->GetRegionCountryId(info.GetMercator());
uint32_t placeCountryType = classif().GetTypeByPath({"place", "country"});
if (info.GetTypes().Has(placeCountryType))
{
TCountriesVec countries;
Storage().GetTopmostNodesFor(info.m_countryId, countries);
if (countries.size() == 1)
info.m_countryId = countries.front();
}
}
void Framework::FillPointInfo(m2::PointD const & mercator, string const & customTitle, place_page::Info & info) const

View file

@ -62,6 +62,10 @@ public:
/// Formatted feature address.
string m_address;
/// Which country this MapObject is in.
/// For a country point it will be set to topmost node for country.
storage::TCountryId m_countryId = storage::kInvalidCountryId;
bool m_isMyPosition = false;
bool m_isEditable = false;