forked from organicmaps/organicmaps
[iOS] pass serverID to elevation profile stats
https://jira.mail.ru/browse/MAPSME-13635
This commit is contained in:
parent
5ea074b1ef
commit
b0f6d6a7ab
5 changed files with 8 additions and 2 deletions
iphone
CoreApi/CoreApi/PlacePageData
ElevationProfile
PlacePageData.mmMaps/UI/PlacePage/Components/ElevationProfile
|
@ -7,6 +7,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@interface ElevationProfileData (Core)
|
||||
|
||||
- (instancetype)initWithElevationInfo:(ElevationInfo const &)elevationInfo
|
||||
serverId:(NSString *)serverId
|
||||
activePoint:(double)activePoint
|
||||
myPosition:(double)myPosition;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ typedef NS_ENUM(NSInteger, ElevationDifficulty) {
|
|||
@interface ElevationProfileData : NSObject
|
||||
|
||||
@property(nonatomic, readonly) uint64_t trackId;
|
||||
@property(nonatomic, readonly) NSString *serverId;
|
||||
@property(nonatomic, readonly) NSUInteger ascent;
|
||||
@property(nonatomic, readonly) NSUInteger descent;
|
||||
@property(nonatomic, readonly) NSUInteger maxAttitude;
|
||||
|
|
|
@ -21,10 +21,12 @@ static ElevationDifficulty convertDifficulty(uint8_t difficulty) {
|
|||
@implementation ElevationProfileData (Core)
|
||||
|
||||
- (instancetype)initWithElevationInfo:(ElevationInfo const &)elevationInfo
|
||||
serverId:(NSString *)serverId
|
||||
activePoint:(double)activePoint
|
||||
myPosition:(double)myPosition {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_serverId = serverId;
|
||||
_trackId = elevationInfo.GetId();
|
||||
_ascent = elevationInfo.GetAscent();
|
||||
_descent = elevationInfo.GetDescent();
|
||||
|
|
|
@ -135,7 +135,9 @@ static PlacePageRoadType convertRoadType(RoadWarningMarkType roadType) {
|
|||
auto const &bm = GetFramework().GetBookmarkManager();
|
||||
auto const &trackId = rawData().GetTrackId();
|
||||
auto const &elevationInfo = bm.MakeElevationInfo(trackId);
|
||||
auto const &serverId = bm.GetCategoryServerId(rawData().GetBookmarkCategoryId());
|
||||
_elevationProfileData = [[ElevationProfileData alloc] initWithElevationInfo:elevationInfo
|
||||
serverId:@(serverId.c_str())
|
||||
activePoint:bm.GetElevationActivePoint(trackId)
|
||||
myPosition:bm.GetElevationMyPosition(trackId)];
|
||||
_previewData = [[PlacePagePreviewData alloc] initWithElevationInfo:elevationInfo];
|
||||
|
|
|
@ -89,12 +89,12 @@ extension ElevationProfilePresenter: ElevationProfilePresenterProtocol {
|
|||
}
|
||||
|
||||
func onAppear() {
|
||||
Statistics.logEvent(kStatElevationProfilePageOpen, withParameters: [kStatServerId: data.trackId,
|
||||
Statistics.logEvent(kStatElevationProfilePageOpen, withParameters: [kStatServerId: data.serverId,
|
||||
kStatState: "preview"])
|
||||
}
|
||||
|
||||
func onDissapear() {
|
||||
Statistics.logEvent(kStatElevationProfilePageClose, withParameters: [kStatServerId: data.trackId])
|
||||
Statistics.logEvent(kStatElevationProfilePageClose, withParameters: [kStatServerId: data.serverId])
|
||||
}
|
||||
|
||||
func onDifficultyButtonPressed() {
|
||||
|
|
Loading…
Add table
Reference in a new issue