diff options
author | vng <viktor.govako@gmail.com> | 2015-09-11 15:25:03 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:04:56 +0300 |
commit | a854db6fdb08ddb6cbbd195898a89628b5c3a391 (patch) | |
tree | 44f90c01e4fc8307210c97c35bc00be8fb6a8c7a /map/framework.cpp | |
parent | d167c19e2b203f94e440dd179f7248f495e978ce (diff) |
[search] Result’s metadata advanced getting.
Diffstat (limited to 'map/framework.cpp')
-rw-r--r-- | map/framework.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index 22f1b236f7..732d3bdb82 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -27,6 +27,7 @@ #include "search/search_engine.hpp" #include "search/search_query_factory.hpp" #include "search/result.hpp" +#include "search/intermediate_result.hpp" #include "indexer/categories_holder.hpp" #include "indexer/classificator_loader.hpp" @@ -1316,6 +1317,24 @@ bool Framework::GetCurrentPosition(double & lat, double & lon) const return false; } +void Framework::LoadSearchResultMetadata(search::Result & res) const +{ + if (res.m_metadata.m_isInitialized) + return; + + FeatureID const id = res.GetFeatureID(); + if (id.IsValid()) + { + Index::FeaturesLoaderGuard loader(m_model.GetIndex(), id.m_mwmId); + + FeatureType ft; + loader.GetFeatureByIndex(id.m_index, ft); + + search::ProcessMetadata(ft, res.m_metadata); + } + res.m_metadata.m_isInitialized = true; +} + void Framework::ShowSearchResult(search::Result const & res) { UserMarkContainer::Type const type = UserMarkContainer::SEARCH_MARK; |