forked from organicmaps/organicmaps
[iOS] add header to PP of outdoor track
This commit is contained in:
parent
2c44f2a701
commit
93523e5f13
3 changed files with 14 additions and 2 deletions
|
@ -6,6 +6,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@interface PlacePagePreviewData (Core)
|
||||
|
||||
- (instancetype)initWithElevationInfo:(ElevationInfo const &)elevationInfo;
|
||||
- (instancetype)initWithRawData:(place_page::Info const &)rawData;
|
||||
|
||||
@end
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue