Welcome to mirror list, hosted at ThFree Co, Russian Federation.

taxi_delegate.cpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0fecf41ad20f1144e3e7f1abb91bd16a66a7f67 (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
31
32
33
#include "map/taxi_delegate.hpp"

#include "search/city_finder.hpp"

#include "storage/country_info_getter.hpp"
#include "storage/index.hpp"
#include "storage/storage.hpp"

#include "coding/multilang_utf8_string.hpp"

TaxiDelegate::TaxiDelegate(storage::Storage const & st, storage::CountryInfoGetter const & ig,
                           search::CityFinder & cf)
  : m_storage(st), m_infoGetter(ig), m_cityFinder(cf)
{
}

storage::TCountriesVec TaxiDelegate::GetCountryIds(m2::PointD const & point)
{
  auto const countryId = m_infoGetter.GetRegionCountryId(point);
  storage::TCountriesVec topmostCountryIds;
  m_storage.GetTopmostNodesFor(countryId, topmostCountryIds);
  return topmostCountryIds;
}

std::string TaxiDelegate::GetCityName(m2::PointD const & point)
{
  return m_cityFinder.GetCityName(point, StringUtf8Multilang::kEnglishCode);
}

storage::TCountryId TaxiDelegate::GetMwmId(m2::PointD const & point)
{
  return m_infoGetter.GetRegionCountryId(point);
}