diff --git a/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift b/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift index e26055f372..edee4c7ff8 100644 --- a/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift +++ b/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift @@ -24,6 +24,7 @@ final class DiscoveryLocalExpertCollectionHolderCell: DiscoveryCollectionHolder @objc func config() { header.text = L("discovery_button_subtitle_local_guides").uppercased() collectionView.register(cellClass: DiscoveryLocalExpertCell.self) + collectionView.register(cellClass: DiscoveryMoreCell.self) } } diff --git a/iphone/Maps/UI/Discovery/DiscoveryMoreCell.xib b/iphone/Maps/UI/Discovery/DiscoveryMoreCell.xib index bb2389af61..38ad424b46 100644 --- a/iphone/Maps/UI/Discovery/DiscoveryMoreCell.xib +++ b/iphone/Maps/UI/Discovery/DiscoveryMoreCell.xib @@ -1,11 +1,11 @@ - + - + @@ -19,39 +19,49 @@ - - - - - - - - - - - - + - - - - - + + + diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm b/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm index 641d742a1d..7aed34975d 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm @@ -156,7 +156,15 @@ struct Callback dest = kStatExternal; break; case ItemType::LocalExperts: - [self openUrl:[NSURL URLWithString:@(m_model.GetExpertAt(index).m_pageUrl.c_str())]]; + if (index == m_model.GetItemsCount(type)) + { + [self openURLForItem:type]; + event = kStatPlacepageSponsoredMoreSelected; + } + else + { + [self openUrl:[NSURL URLWithString:@(m_model.GetExpertAt(index).m_pageUrl.c_str())]]; + } dest = kStatExternal; break; case ItemType::Attractions: diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm index 7b25f6b587..c47ff543f6 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm @@ -342,7 +342,8 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) numberOfItemsInSection:(NSInteger)section { auto const count = self.model().GetItemsCount(collectionView.itemType); - if (collectionView.itemType == ItemType::Hotels) + auto type = collectionView.itemType; + if (type == ItemType::Hotels || type == ItemType::LocalExperts) return count > 0 ? count + 1 : 0; return count; @@ -399,6 +400,15 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) } case ItemType::LocalExperts: { + if (indexPath.row == model.GetItemsCount(type)) + { + Class cls = [MWMDiscoveryMoreCell class]; + auto cell = static_cast([collectionView + dequeueReusableCellWithCellClass:cls + indexPath:indexPath]); + return cell; + } + Class cls = [MWMDiscoveryLocalExpertCell class]; auto cell = static_cast( [collectionView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); diff --git a/map/discovery/discovery_manager.cpp b/map/discovery/discovery_manager.cpp index 04cdfb80fc..74dc2cc42a 100644 --- a/map/discovery/discovery_manager.cpp +++ b/map/discovery/discovery_manager.cpp @@ -1,5 +1,7 @@ #include "map/discovery/discovery_manager.hpp" +#include + namespace { std::string GetQuery(discovery::ItemType const type) @@ -50,8 +52,10 @@ std::string Manager::GetViatorUrl(m2::PointD const & point) const std::string Manager::GetLocalExpertsUrl(m2::PointD const & point) const { - UNUSED_VALUE(point); - return locals::Api::GetLocalsPageUrl(); + ms::LatLon const ll(MercatorBounds::ToLatLon(point)); + std::ostringstream os; + os << locals::Api::GetLocalsPageUrl() << "?lat=" << ll.lat << "&lon=" << ll.lon; + return os.str(); } std::string Manager::GetCityViatorId(m2::PointD const & point) const