[iOS] add header to PP of outdoor track

This commit is contained in:
Aleksey Belousov 2020-04-01 12:25:28 +03:00 committed by Vladimir Byko-Ianko
parent 2c44f2a701
commit 93523e5f13
3 changed files with 14 additions and 2 deletions

View file

@ -6,6 +6,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface PlacePagePreviewData (Core)
- (instancetype)initWithElevationInfo:(ElevationInfo const &)elevationInfo;
- (instancetype)initWithRawData:(place_page::Info const &)rawData;
@end

View file

@ -61,6 +61,14 @@ static PlacePageDataHotelType convertHotelType(std::optional<ftypes::IsHotelChec
@implementation PlacePagePreviewData (Core)
- (instancetype)initWithElevationInfo:(ElevationInfo const &)elevationInfo {
self = [super init];
if (self) {
_title = @(elevationInfo.GetName().c_str());
}
return self;
}
- (instancetype)initWithRawData:(place_page::Info const &)rawData {
self = [super init];
if (self) {

View file

@ -77,7 +77,6 @@ static PlacePageRoadType convertRoadType(RoadWarningMarkType roadType) {
self = [super init];
if (self) {
_buttonsData = [[PlacePageButtonsData alloc] initWithRawData:rawData()];
_previewData = [[PlacePagePreviewData alloc] initWithRawData:rawData()];
_infoData = [[PlacePageInfoData alloc] initWithRawData:rawData() ohLocalization:localization];
if (rawData().IsBookmark()) {
@ -135,9 +134,13 @@ static PlacePageRoadType convertRoadType(RoadWarningMarkType roadType) {
if (rawData().IsTrack()) {
auto const &bm = GetFramework().GetBookmarkManager();
auto const &trackId = rawData().GetTrackId();
_elevationProfileData = [[ElevationProfileData alloc] initWithElevationInfo:bm.MakeElevationInfo(trackId)
auto const &elevationInfo = bm.MakeElevationInfo(trackId);
_elevationProfileData = [[ElevationProfileData alloc] initWithElevationInfo:elevationInfo
activePoint:bm.GetElevationActivePoint(trackId)
myPosition:bm.GetElevationMyPosition(trackId)];
_previewData = [[PlacePagePreviewData alloc] initWithElevationInfo:elevationInfo];
} else {
_previewData = [[PlacePagePreviewData alloc] initWithRawData:rawData()];
}
auto const &countryId = rawData().GetCountryId();