diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-07-31 19:26:52 +0300 |
---|---|---|
committer | Vlad Mihaylenko <vxmihaylenko@gmail.com> | 2018-08-07 17:29:07 +0300 |
commit | 1e20743f0a61e78c7f3a609c4762f41fb6c6896b (patch) | |
tree | 2ddb5a6a8ed5fdca7de2d1a6ac19e0dd5927f048 /map | |
parent | 4d98c2a6284d079d4d65d6d0c1505e01586c1225 (diff) |
[indexer] popularity for place page
Diffstat (limited to 'map')
-rw-r--r-- | map/framework.cpp | 2 | ||||
-rw-r--r-- | map/framework.hpp | 3 | ||||
-rw-r--r-- | map/place_page_info.hpp | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index f45feb8d05..62ff6e1a94 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -387,6 +387,7 @@ Framework::Framework(FrameworkParams const & params) m_drapeEngine->SetDisplacementMode(mode); }) , m_lastReportedCountry(kInvalidCountryId) + , m_popularityLoader(m_model.GetDataSource()) { m_startBackgroundTime = my::Timer::LocalTime(); @@ -909,6 +910,7 @@ void Framework::FillInfoFromFeatureType(FeatureType & ft, place_page::Info & inf auto const latlon = MercatorBounds::ToLatLon(feature::GetCenter(ft)); ASSERT(m_taxiEngine, ()); info.SetReachableByTaxiProviders(m_taxiEngine->GetProvidersAtPos(latlon)); + info.SetPopularity(m_popularityLoader.Get(ft.GetID())); } void Framework::FillApiMarkInfo(ApiMarkPoint const & api, place_page::Info & info) const diff --git a/map/framework.hpp b/map/framework.hpp index d2f916309b..c7c3beec1c 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -38,6 +38,7 @@ #include "indexer/data_source.hpp" #include "indexer/data_source_helpers.hpp" #include "indexer/map_style.hpp" +#include "indexer/popularity_loader.hpp" #include "search/city_finder.hpp" #include "search/displayed_categories.hpp" @@ -522,6 +523,8 @@ private: void OnUpdateGpsTrackPointsCallback(vector<pair<size_t, location::GpsTrackInfo>> && toAdd, pair<size_t, size_t> const & toRemove); + CachingPopularityLoader m_popularityLoader; + public: using TSearchRequest = search::QuerySaver::TSearchRequest; diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp index d3c1628daa..a357d232a8 100644 --- a/map/place_page_info.hpp +++ b/map/place_page_info.hpp @@ -217,6 +217,9 @@ public: boost::optional<ftypes::IsHotelChecker::Type> GetHotelType() const { return m_hotelType; } + void SetPopularity(uint8_t popularity) { m_popularity = popularity; } + uint8_t GetPopularity() const { return m_popularity; } + private: std::string FormatSubtitle(bool withType) const; void GetPrefferedNames(std::string & primaryName, std::string & secondaryName) const; @@ -303,6 +306,8 @@ private: feature::TypesHolder m_sortedTypes; boost::optional<ftypes::IsHotelChecker::Type> m_hotelType; + + uint8_t m_popularity = 0; }; namespace rating |