Files
comaps/search/region_address_getter.cpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

35 lines
1.2 KiB
C++

#include "search/region_address_getter.hpp"
#include "storage/country_info_getter.hpp"
#include "platform/preferred_languages.hpp"
namespace search
{
RegionAddressGetter::RegionAddressGetter(DataSource const & dataSource,
storage::CountryInfoGetter const & infoGetter)
: m_reverseGeocoder(dataSource), m_cityFinder(dataSource), m_infoGetter(infoGetter)
{
m_nameGetter.LoadCountriesTree();
m_nameGetter.SetLocale(languages::GetCurrentMapLanguage());
}
ReverseGeocoder::RegionAddress RegionAddressGetter::GetNearbyRegionAddress(
m2::PointD const & center)
{
return ReverseGeocoder::GetNearbyRegionAddress(center, m_infoGetter, m_cityFinder);
}
std::string RegionAddressGetter::GetLocalizedRegionAddress(
ReverseGeocoder::RegionAddress const & addr) const
{
return m_reverseGeocoder.GetLocalizedRegionAddress(addr, m_nameGetter);
}
std::string RegionAddressGetter::GetLocalizedRegionAddress(m2::PointD const & center)
{
auto const addr = ReverseGeocoder::GetNearbyRegionAddress(center, m_infoGetter, m_cityFinder);
return m_reverseGeocoder.GetLocalizedRegionAddress(addr, m_nameGetter);
}
} // namespace search