blob: 2cfd0a2587528fa00babc5baae8f1b492e285478 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include "search/city_finder.hpp"
#include "indexer/feature_decl.hpp"
using namespace std;
namespace search
{
CityFinder::CityFinder(DataSource const & dataSource)
: m_unusedBoundaries(dataSource)
, m_unusedCache(m_cancellable)
, m_finder(dataSource, m_unusedBoundaries, m_unusedCache)
{
}
string CityFinder::GetCityName(m2::PointD const & p, int8_t lang)
{
string city;
m_finder.GetLocality(
p, [&](LocalityItem const & item) { item.GetSpecifiedOrDefaultName(lang, city); });
return city;
}
FeatureID CityFinder::GetCityFeatureID(m2::PointD const & p)
{
FeatureID id;
m_finder.GetLocality(p, [&id](LocalityItem const & item) { id = item.m_id; });
return id;
}
} // namespace search
|