diff --git a/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java b/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java index 9363c5bd46..b2a92535c8 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java +++ b/android/src/com/mapswithme/maps/widget/placepage/Sponsored.java @@ -30,10 +30,11 @@ public final class Sponsored public static final int TYPE_HOLIDAY = 4; public static final int TYPE_PROMO_CATALOG_CITY = 5; public static final int TYPE_PROMO_CATALOG_SIGHTSEEINGS = 6; + public static final int TYPE_PROMO_CATALOG_OUTDOOR = 7; @Retention(RetentionPolicy.SOURCE) @IntDef({ TYPE_NONE, TYPE_BOOKING, TYPE_OPENTABLE, TYPE_PARTNER, TYPE_HOLIDAY, - TYPE_PROMO_CATALOG_CITY, TYPE_PROMO_CATALOG_SIGHTSEEINGS }) + TYPE_PROMO_CATALOG_CITY, TYPE_PROMO_CATALOG_SIGHTSEEINGS, TYPE_PROMO_CATALOG_OUTDOOR }) public @interface SponsoredType {} static class FacilityType diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java index 42db9632d1..044ce00567 100644 --- a/android/src/com/mapswithme/util/statistics/Statistics.java +++ b/android/src/com/mapswithme/util/statistics/Statistics.java @@ -1303,9 +1303,8 @@ public enum Statistics case Sponsored.TYPE_PARTNER: return PARTNER; case Sponsored.TYPE_PROMO_CATALOG_CITY: - return MAPSME_GUIDES; case Sponsored.TYPE_PROMO_CATALOG_SIGHTSEEINGS: - // TODO: Dummy, fix with correct value when documentation will be done. + case Sponsored.TYPE_PROMO_CATALOG_OUTDOOR: return MAPSME_GUIDES; case Sponsored.TYPE_NONE: return "N/A"; diff --git a/map/framework.cpp b/map/framework.cpp index 16383952b1..2acbe2c853 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -925,6 +925,13 @@ void Framework::FillInfoFromFeatureType(FeatureType & ft, place_page::Info & inf : place_page::OpeningMode::PreviewPlus); info.SetSponsoredType(SponsoredType::PromoCatalogSightseeings); } + else if (ftypes::IsPromoCatalogOutdoorChecker::Instance()(ft)) + { + info.SetOpeningMode(m_routingManager.IsRoutingActive() || !GetPlatform().IsConnected() + ? place_page::OpeningMode::Preview + : place_page::OpeningMode::PreviewPlus); + info.SetSponsoredType(SponsoredType::PromoCatalogOutdoor); + } FillLocalExperts(ft, info); FillDescription(ft, info); diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp index 3d13fcb495..46b26935cb 100644 --- a/map/place_page_info.hpp +++ b/map/place_page_info.hpp @@ -50,6 +50,7 @@ enum class SponsoredType Holiday, PromoCatalogCity, PromoCatalogSightseeings, + PromoCatalogOutdoor, }; enum class LocalAdsStatus diff --git a/map/promo_catalog_poi_checker.hpp b/map/promo_catalog_poi_checker.hpp index 1bb7c7020a..6f488cba4d 100644 --- a/map/promo_catalog_poi_checker.hpp +++ b/map/promo_catalog_poi_checker.hpp @@ -20,14 +20,17 @@ protected: } }; -class IsPromoCatalogSightseeingsChecker : public IsPromoCatalogPoiChecker -{ -public: - DECLARE_CHECKER_INSTANCE(IsPromoCatalogSightseeingsChecker); +#define PROMO_CATALOG_CHECKER(ClassName, TypesGetter) \ + class ClassName : public IsPromoCatalogPoiChecker \ + { \ + public: \ + DECLARE_CHECKER_INSTANCE(ClassName); \ + private: \ + ClassName() \ + : IsPromoCatalogPoiChecker(TypesGetter) \ + {} \ + }; -private: - IsPromoCatalogSightseeingsChecker() - : IsPromoCatalogPoiChecker(promo::GetPromoCatalogSightseeingsTypes()) - {} -}; +PROMO_CATALOG_CHECKER(IsPromoCatalogSightseeingsChecker, promo::GetPromoCatalogSightseeingsTypes()) +PROMO_CATALOG_CHECKER(IsPromoCatalogOutdoorChecker, promo::GetPromoCatalogOutdoorTypes()) } // namespace ftypes diff --git a/partners_api/promo_catalog_types.cpp b/partners_api/promo_catalog_types.cpp index b6083821c8..75300297ed 100644 --- a/partners_api/promo_catalog_types.cpp +++ b/partners_api/promo_catalog_types.cpp @@ -23,6 +23,25 @@ promo::TypesList kSightseeingsTypes = { {"tourism", "viewpoint"}, {"amenity", "place_of_worship"}, }; + +promo::TypesList kOutdoorTypes = { + {"place", "village"}, + {"place", "hamlet"}, + {"natural", "volcano"}, + {"waterway", "waterfall"}, + {"natural", "cave_entrance"}, + {"landuse", "forest"}, + {"leisure", "nature_reserve"}, + {"natural", "cliff"}, + {"natural", "peak"}, + {"natural", "rock"}, + {"natural", "wood"}, + {"natural", "bare_rock"}, + {"natural", "glacier"}, + {"leisure", "park"}, + {"boundary", "national_park"} +}; + } // namespace namespace promo @@ -31,4 +50,9 @@ TypesList const & GetPromoCatalogSightseeingsTypes() { return kSightseeingsTypes; } + +TypesList const & GetPromoCatalogOutdoorTypes() +{ + return kOutdoorTypes; +} } // namespace promo diff --git a/partners_api/promo_catalog_types.hpp b/partners_api/promo_catalog_types.hpp index 14de0bb90a..c512fcedba 100644 --- a/partners_api/promo_catalog_types.hpp +++ b/partners_api/promo_catalog_types.hpp @@ -6,4 +6,5 @@ namespace promo { using TypesList = std::initializer_list>; TypesList const & GetPromoCatalogSightseeingsTypes(); +TypesList const & GetPromoCatalogOutdoorTypes(); } // namespace promo