diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h index 93ea1ae20f..b13a99a62c 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h @@ -32,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly, nullable) NSString *wheelchair; @property(nonatomic, readonly, nullable) NSString *driveThrough; @property(nonatomic, readonly, nullable) NSString *websiteMenu; +@property(nonatomic, readonly, nullable) NSString *selfService; +@property(nonatomic, readonly, nullable) NSString *outdoorSeating; @end diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm index 0495fa5889..5fa65ac321 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm @@ -8,12 +8,18 @@ #include "indexer/validate_and_format_contacts.hpp" #include "indexer/kayak.hpp" +#include "indexer/feature_meta.hpp" #include "map/place_page_info.hpp" using namespace place_page; using namespace osm; +/// Get localized metadata value string when string format is "type.feature.value". +NSString * GetLocalizedMetadataValueString(MapObject::MetadataID metaID, std::string const & value) { + return ToNSString(platform::GetLocalizedTypeName(feature::ToString(metaID) + "." + value)); +} + @implementation PlacePageInfoData @end @@ -84,13 +90,18 @@ using namespace osm; _driveThrough = NSLocalizedString(@"drive_through", nil); break; case MetadataID::FMD_WEBSITE_MENU: _websiteMenu = ToNSString(value); break; + case MetadataID::FMD_SELF_SERVICE: _selfService = GetLocalizedMetadataValueString(metaID, value); break; + case MetadataID::FMD_OUTDOOR_SEATING: + if (value == "yes") + _outdoorSeating = NSLocalizedString(@"outdoor_seating", nil); + break; default: break; } }); - + _atm = rawData.HasAtm() ? NSLocalizedString(@"type.amenity.atm", nil) : nil; - + _address = rawData.GetAddress().empty() ? nil : @(rawData.GetAddress().c_str()); _coordFormats = @[@(rawData.GetFormattedCoordinate(place_page::CoordinatesFormat::LatLonDMS).c_str()), @(rawData.GetFormattedCoordinate(place_page::CoordinatesFormat::LatLonDecimal).c_str()), diff --git a/iphone/Maps/Images.xcassets/Place Page/ic_placepage_outdoor_seating.imageset/Contents.json b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_outdoor_seating.imageset/Contents.json new file mode 100644 index 0000000000..c5fbed49e8 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_outdoor_seating.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ic_placepage_outdoor_seating.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/iphone/Maps/Images.xcassets/Place Page/ic_placepage_outdoor_seating.imageset/ic_placepage_outdoor_seating.svg b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_outdoor_seating.imageset/ic_placepage_outdoor_seating.svg new file mode 100644 index 0000000000..18c2cdf0c9 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_outdoor_seating.imageset/ic_placepage_outdoor_seating.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/iphone/Maps/Images.xcassets/Place Page/ic_placepage_self_service.imageset/Contents.json b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_self_service.imageset/Contents.json new file mode 100644 index 0000000000..40455e7590 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_self_service.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ic_placepage_self_service.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/iphone/Maps/Images.xcassets/Place Page/ic_placepage_self_service.imageset/ic_placepage_self_service.svg b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_self_service.imageset/ic_placepage_self_service.svg new file mode 100644 index 0000000000..83d12ceb93 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_self_service.imageset/ic_placepage_self_service.svg @@ -0,0 +1,3 @@ + + + diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift index a0fdddd9aa..3481eb7c55 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift @@ -127,6 +127,8 @@ class PlacePageInfoViewController: UIViewController { private var openWithAppView: InfoItemViewController? private var capacityView: InfoItemViewController? private var wheelchairView: InfoItemViewController? + private var selfServiceView: InfoItemViewController? + private var outdoorSeatingView: InfoItemViewController? private var driveThroughView: InfoItemViewController? var placePageInfoData: PlacePageInfoData! @@ -251,6 +253,14 @@ class PlacePageInfoViewController: UIViewController { wheelchairView = createInfoItem(wheelchair, icon: UIImage(named: "ic_placepage_wheelchair")) } + if let selfService = placePageInfoData.selfService { + selfServiceView = createInfoItem(selfService, icon: UIImage(named: "ic_placepage_self_service")) + } + + if let outdoorSeating = placePageInfoData.outdoorSeating { + outdoorSeatingView = createInfoItem(outdoorSeating, icon: UIImage(named: "ic_placepage_outdoor_seating")) + } + if let driveThrough = placePageInfoData.driveThrough { driveThroughView = createInfoItem(driveThrough, icon: UIImage(named: "ic_placepage_drive_through")) }