diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2016-06-21 18:53:37 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-06-24 16:02:07 +0300 |
commit | a2becb8dd1124e79c5602ceb1ba8c94e1e935fa8 (patch) | |
tree | 93f79b21b4301decfbbaad15ba90b61790ffba3b /map | |
parent | 098ca2f3a91d14cb7a0f2f016f88829e32e8d3ab (diff) |
Fix downloading behaviour in place page
Diffstat (limited to 'map')
-rw-r--r-- | map/framework.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index d5932d178d..f63743f6e5 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -709,13 +709,22 @@ void Framework::FillFeatureInfo(FeatureID const & fid, place_page::Info & info) FillInfoFromFeatureType(ft, info); // Fill countryId for place page info + uint32_t const placeContinentType = classif().GetTypeByPath({"place", "continent"}); + if (info.GetTypes().Has(placeContinentType)) + return; + info.m_countryId = m_infoGetter->GetRegionCountryId(info.GetMercator()); - uint32_t placeCountryType = classif().GetTypeByPath({"place", "country"}); - if (info.GetTypes().Has(placeCountryType)) + uint32_t const placeCountryType = classif().GetTypeByPath({"place", "country"}); + uint32_t const placeStateType = classif().GetTypeByPath({"place", "state"}); + + bool const isState = info.GetTypes().Has(placeStateType); + bool const isCountry = info.GetTypes().Has(placeCountryType); + if (isCountry || isState) { + size_t const level = isState ? 1 : 0; TCountriesVec countries; - Storage().GetTopmostNodesFor(info.m_countryId, countries); + Storage().GetTopmostNodesFor(info.m_countryId, countries, level); if (countries.size() == 1) info.m_countryId = countries.front(); } |