diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2016-06-06 15:58:40 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-06-23 18:58:27 +0300 |
commit | 79da2f91d1a3feef5e267e004671656bdc2b40a0 (patch) | |
tree | ebb53bf41c7cdb765883c5c57dc4889aa5df242b /map | |
parent | 7e9b9d96822d2710616a661eb69db70d3f1ecaa7 (diff) |
[booking] Add methods for getting sponsored urls for place page
Diffstat (limited to 'map')
-rw-r--r-- | map/framework.cpp | 5 | ||||
-rw-r--r-- | map/place_page_info.cpp | 3 | ||||
-rw-r--r-- | map/place_page_info.hpp | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index eab2c3b488..4372fa6295 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -744,7 +744,12 @@ void Framework::FillInfoFromFeatureType(FeatureType const & ft, place_page::Info info.m_address = GetAddressInfoAtPoint(feature::GetCenter(ft)).FormatHouseAndStreet(); if (ftypes::IsBookingChecker::Instance()(ft)) + { info.m_isSponsoredHotel = true; + string const & baseUrl = info.GetMetadata().Get(feature::Metadata::FMD_WEBSITE); + info.m_sponsoredBookingUrl = GetBookingApi().GetBookingUrl(baseUrl); + info.m_sponsoredDescriptionUrl = GetBookingApi().GetDescriptionUrl(baseUrl); + } info.m_isEditable = featureStatus != osm::Editor::FeatureStatus::Obsolete && !info.IsSponsoredHotel(); diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp index 1116e3539f..2b94a56923 100644 --- a/map/place_page_info.cpp +++ b/map/place_page_info.cpp @@ -101,6 +101,9 @@ BookmarkAndCategory Info::GetBookmarkAndCategory() const { return m_bac; } string Info::GetBookmarkCategoryName() const { return m_bookmarkCategoryName; } string const & Info::GetApiUrl() const { return m_apiUrl; } +string const & Info::GetSponsoredBookingUrl() const { return m_sponsoredBookingUrl; } +string const & Info::GetSponsoredDescriptionUrl() const {return m_sponsoredDescriptionUrl; } + string Info::GetRatingFormatted() const { if (!IsSponsoredHotel()) diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp index b6eaf8fb1a..dda6988242 100644 --- a/map/place_page_info.hpp +++ b/map/place_page_info.hpp @@ -56,6 +56,9 @@ public: string GetBookmarkCategoryName() const; string const & GetApiUrl() const; + string const & GetSponsoredBookingUrl() const; + string const & GetSponsoredDescriptionUrl() const; + /// @returns formatted rating string for booking object, or empty if it isn't booking object string GetRatingFormatted() const; /// @returns string with |kPricingSymbol| signs or empty string if it isn't booking object @@ -77,6 +80,9 @@ public: string m_address; /// Feature is a sponsored hotel. bool m_isSponsoredHotel = false; + /// Sponsored feature urls. + string m_sponsoredBookingUrl; + string m_sponsoredDescriptionUrl; /// Which country this MapObject is in. /// For a country point it will be set to topmost node for country. |