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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-05-11 11:27:56 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:38:17 +0300
commit41903e736053d04ce161fe83fa0849b6cf9483f2 (patch)
treedf208389a294ca2ec50527ae083558166618eea4 /map/address_finder.cpp
parentb24f4e6e00079e3d5de19815d50349af12e9645b (diff)
Framework::GetAddressInfo - add feature type (category) strings.
Diffstat (limited to 'map/address_finder.cpp')
-rw-r--r--map/address_finder.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/map/address_finder.cpp b/map/address_finder.cpp
index ae3e32cd40..0a922b019d 100644
--- a/map/address_finder.cpp
+++ b/map/address_finder.cpp
@@ -3,6 +3,8 @@
#include "../indexer/classificator.hpp"
#include "../indexer/feature_visibility.hpp"
+#include "../platform/preferred_languages.hpp"
+
namespace
{
@@ -305,8 +307,10 @@ namespace
m_cont.clear();
}
- void FillAddress(Framework::AddressInfo & info)
+ void FillAddress(search::Engine const * eng, Framework::AddressInfo & info)
{
+ int8_t const lang = StringUtf8Multilang::GetLangIndex(languages::CurrentLanguage());
+
SortResults();
for (size_t i = 0; i < m_cont.size(); ++i)
@@ -322,7 +326,17 @@ namespace
if (info.m_name.empty())
{
if (m_cont[i].m_types.GetGeoType() != feature::GEOM_LINE)
+ {
info.m_name = m_cont[i].m_name;
+
+ // add types for POI
+ size_t const count = m_cont[i].m_types.Size();
+ info.m_types.resize(count);
+ for (size_t j = 0; j < count; ++j)
+ {
+ eng->GetNameByType(m_cont[i].m_types[j], lang, info.m_types[j]);
+ }
+ }
}
if (!(info.m_street.empty() || info.m_name.empty()))
@@ -374,7 +388,7 @@ void Framework::GetAddressInfo(m2::PointD const & pt, AddressInfo & info) const
m_model.ForEachFeature(
MercatorBounds::RectByCenterXYAndSizeInMeters(pt, addressR), getAddress, scale);
- getAddress.FillAddress(info);
+ getAddress.FillAddress(GetSearchEngine(), info);
}
// now - get the locality