diff --git a/storage/country_info_getter.cpp b/storage/country_info_getter.cpp index faba3c0b84..6582d70aa1 100644 --- a/storage/country_info_getter.cpp +++ b/storage/country_info_getter.cpp @@ -88,17 +88,16 @@ std::vector CountryInfoGetter::GetRegionsCountryIdByRect(m2::RectD co return result; } -void CountryInfoGetter::GetRegionsCountryId(m2::PointD const & pt, CountriesVec & closestCoutryIds) +void CountryInfoGetter::GetRegionsCountryId(m2::PointD const & pt, CountriesVec & closestCoutryIds, + double lookupRadiusM) { - double const kLookupRadiusM = 30 /* km */ * 1000; - closestCoutryIds.clear(); - m2::RectD const lookupRect = MercatorBounds::RectByCenterXYAndSizeInMeters(pt, kLookupRadiusM); + m2::RectD const lookupRect = MercatorBounds::RectByCenterXYAndSizeInMeters(pt, lookupRadiusM); for (size_t id = 0; id < m_countries.size(); ++id) { - if (m_countries[id].m_rect.IsIntersect(lookupRect) && IsCloseEnough(id, pt, kLookupRadiusM)) + if (m_countries[id].m_rect.IsIntersect(lookupRect) && IsCloseEnough(id, pt, lookupRadiusM)) closestCoutryIds.emplace_back(m_countries[id].m_countryId); } } diff --git a/storage/country_info_getter.hpp b/storage/country_info_getter.hpp index d9cf318c95..93c6c767da 100644 --- a/storage/country_info_getter.hpp +++ b/storage/country_info_getter.hpp @@ -73,7 +73,8 @@ public: // |closestCoutryIds| is filled with country ids of mwms that cover |pt| or are close to it // with the exception of World.mwm and custom user-provided mwms. // The result may be empty, for example if |pt| is somewhere in an ocean. - void GetRegionsCountryId(m2::PointD const & pt, CountriesVec & closestCoutryIds); + void GetRegionsCountryId(m2::PointD const & pt, CountriesVec & closestCoutryIds, + double lookupRadiusM = 30000.0 /* 30 km */); // Fills info for the region |pt| belongs to. void GetRegionInfo(m2::PointD const & pt, CountryInfo & info) const;