forked from organicmaps/organicmaps
[MAPSME-5047] [ios] Added routing manager statistics.
This commit is contained in:
parent
3c1366ab10
commit
b36e213b12
6 changed files with 45 additions and 45 deletions
|
@ -161,13 +161,6 @@ BOOL defaultOrientation(CGSize const & size)
|
|||
NSAssert([MWMLocationManager lastLocation],
|
||||
@"Action button is active while my location is not available");
|
||||
|
||||
[Statistics logEvent:kStatRoutingAddPoint
|
||||
withParameters:@{
|
||||
kStatRoutingPointType : kStatRoutingPointTypeStart,
|
||||
kStatRoutingPointValue : kStatRoutingPointValueMyPosition,
|
||||
kStatRoutingPointMethod : kStatRoutingPointMethodPlanning,
|
||||
kStatRoutingMode : kStatRoutingModePlanning
|
||||
}];
|
||||
[MWMRouter
|
||||
buildFromPoint:[[MWMRoutePoint alloc] initWithLastLocationAndType:MWMRoutePointTypeStart
|
||||
intermediateIndex:0]
|
||||
|
|
|
@ -73,6 +73,8 @@ final class RouteManagerViewController: MWMViewController, UITableViewDataSource
|
|||
tv.cellForRow(at: newIP)?.isHidden = true
|
||||
|
||||
self.indexPath = newIP
|
||||
|
||||
Statistics.logEvent(kStatRouteManagerRearrange)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,6 +152,13 @@ final class RouteManagerViewController: MWMViewController, UITableViewDataSource
|
|||
super.viewDidAppear(animated)
|
||||
dimView.setViews(container: containerView, controller: view, manager: managerView)
|
||||
containerView.insertSubview(chromeView, at: 0)
|
||||
|
||||
Statistics.logEvent(kStatRouteManagerOpen)
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
Statistics.logEvent(kStatRouteManagerClose)
|
||||
}
|
||||
|
||||
override func viewWillLayoutSubviews() {
|
||||
|
|
|
@ -239,21 +239,6 @@ using namespace osm_auth_ios;
|
|||
auto const points = parsedData.m_points;
|
||||
if (points.size() == 2)
|
||||
{
|
||||
[Statistics logEvent:kStatRoutingAddPoint
|
||||
withParameters:@{
|
||||
kStatRoutingPointType : kStatRoutingPointTypeStart,
|
||||
kStatRoutingPointValue : kStatRoutingPointValuePoint,
|
||||
kStatRoutingPointMethod : kStatRoutingPointMethodApi,
|
||||
kStatRoutingMode : kStatRoutingModePlanning
|
||||
}];
|
||||
[Statistics logEvent:kStatRoutingAddPoint
|
||||
withParameters:@{
|
||||
kStatRoutingPointType : kStatRoutingPointTypeFinish,
|
||||
kStatRoutingPointValue : kStatRoutingPointValuePoint,
|
||||
kStatRoutingPointMethod : kStatRoutingPointMethodApi,
|
||||
kStatRoutingMode : kStatRoutingModePlanning
|
||||
}];
|
||||
|
||||
auto p1 = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.front()
|
||||
type:MWMRoutePointTypeStart
|
||||
intermediateIndex:0];
|
||||
|
|
|
@ -185,12 +185,9 @@ static NSString * const kStatPlacePageOwnershipButtonClick = @"Placepage_Ownersh
|
|||
static NSString * const kStatPlacePageRestaurantBook = @"Placepage_Restaurant_book";
|
||||
static NSString * const kStatPlacePageTaxiClick = @"Placepage_Taxi_click";
|
||||
static NSString * const kStatPlacepageSponsoredError = @"Placepage_SponsoredGallery_error";
|
||||
static NSString * const kStatPlacepageSponsoredItemSelected =
|
||||
@"Placepage_SponsoredGallery_ProductItem_selected";
|
||||
static NSString * const kStatPlacepageSponsoredLogoSelected =
|
||||
@"Placepage_SponsoredGallery_LogoItem_selected";
|
||||
static NSString * const kStatPlacepageSponsoredMoreSelected =
|
||||
@"Placepage_SponsoredGallery_MoreItem_selected";
|
||||
static NSString * const kStatPlacepageSponsoredItemSelected = @"Placepage_SponsoredGallery_ProductItem_selected";
|
||||
static NSString * const kStatPlacepageSponsoredLogoSelected = @"Placepage_SponsoredGallery_LogoItem_selected";
|
||||
static NSString * const kStatPlacepageSponsoredMoreSelected = @"Placepage_SponsoredGallery_MoreItem_selected";
|
||||
static NSString * const kStatPlacepageSponsoredOpen = @"Placepage_SponsoredGalleryPage_opened";
|
||||
static NSString * const kStatPlacepageSponsoredShow = @"Placepage_SponsoredGallery_shown";
|
||||
static NSString * const kStatPlacepageTaxiShow = @"Placepage_Taxi_show";
|
||||
|
@ -212,6 +209,9 @@ static NSString * const kStatReport = @"Report";
|
|||
static NSString * const kStatRestaurant = @"restaurant";
|
||||
static NSString * const kStatRestaurantLocation = @"restaurant_location";
|
||||
static NSString * const kStatRetry = @"retry";
|
||||
static NSString * const kStatRouteManagerClose = @"Routing_RouteManager_close";
|
||||
static NSString * const kStatRouteManagerOpen = @"Routing_RouteManager_open";
|
||||
static NSString * const kStatRouteManagerRearrange = @"Routing_RouteManager_rearrange";
|
||||
static NSString * const kStatRouting = @"routing";
|
||||
static NSString * const kStatRoutingAddPoint = @"Routing_Point_add";
|
||||
static NSString * const kStatRoutingBookmarksClicked = @"Routing_Bookmarks_click";
|
||||
|
|
|
@ -33,14 +33,18 @@
|
|||
auto router = [MWMRouter router];
|
||||
if (router.routeManagerTransactionId == RoutingManager::InvalidRoutePointsTransactionId())
|
||||
return;
|
||||
GetFramework().GetRoutingManager().CancelRoutePointsTransaction(router.routeManagerTransactionId);
|
||||
auto & rm = GetFramework().GetRoutingManager();
|
||||
rm.CancelRoutePointsTransaction(router.routeManagerTransactionId);
|
||||
router.routeManagerTransactionId = RoutingManager::InvalidRoutePointsTransactionId();
|
||||
rm.CancelPreviewMode();
|
||||
}
|
||||
|
||||
+ (void)movePointAtIndex:(NSInteger)index toIndex:(NSInteger)newIndex
|
||||
{
|
||||
NSAssert(index != newIndex, @"Route manager moves point to its' current position.");
|
||||
GetFramework().GetRoutingManager().MoveRoutePoint(index, newIndex);
|
||||
auto & rm = GetFramework().GetRoutingManager();
|
||||
rm.MoveRoutePoint(index, newIndex);
|
||||
rm.UpdatePreviewMode();
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -31,6 +31,20 @@
|
|||
|
||||
using namespace routing;
|
||||
|
||||
@interface MWMRouter ()<MWMLocationObserver, MWMFrameworkRouteBuilderObserver>
|
||||
|
||||
@property(nonatomic) NSMutableDictionary<NSValue *, NSData *> * altitudeImagesData;
|
||||
@property(nonatomic) NSString * altitudeElevation;
|
||||
@property(nonatomic) dispatch_queue_t renderAltitudeImagesQueue;
|
||||
@property(nonatomic) uint32_t taxiRoutePointTransactionId;
|
||||
@property(nonatomic) uint32_t routeManagerTransactionId;
|
||||
@property(nonatomic) BOOL canAutoAddLastLocation;
|
||||
@property(nonatomic) BOOL isAPICall;
|
||||
|
||||
+ (MWMRouter *)router;
|
||||
|
||||
@end
|
||||
|
||||
namespace
|
||||
{
|
||||
char const * kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeImagesQueue";
|
||||
|
@ -47,33 +61,26 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType)
|
|||
case MWMRoutePointTypeIntermediate: pointTypeStr = kStatRoutingPointTypeIntermediate; break;
|
||||
case MWMRoutePointTypeFinish: pointTypeStr = kStatRoutingPointTypeFinish; break;
|
||||
}
|
||||
BOOL const isPlanning =
|
||||
[MWMNavigationDashboardManager manager].state != MWMNavigationDashboardStateHidden;
|
||||
BOOL const isOnRoute =
|
||||
[MWMNavigationDashboardManager manager].state != MWMNavigationDashboardStateNavigation;
|
||||
NSString * method = nil;
|
||||
if ([MWMRouter router].isAPICall)
|
||||
method = kStatRoutingPointMethodApi;
|
||||
else if ([MWMNavigationDashboardManager manager].state != MWMNavigationDashboardStateHidden)
|
||||
method = kStatRoutingPointMethodPlanning;
|
||||
else
|
||||
method = kStatRoutingPointMethodNoPlanning;
|
||||
[Statistics logEvent:eventType
|
||||
withParameters:@{
|
||||
kStatRoutingPointType : pointTypeStr,
|
||||
kStatRoutingPointValue :
|
||||
(point.isMyPosition ? kStatRoutingPointValueMyPosition : kStatRoutingPointValuePoint),
|
||||
kStatRoutingPointMethod :
|
||||
(isPlanning ? kStatRoutingPointMethodPlanning : kStatRoutingPointMethodNoPlanning),
|
||||
kStatRoutingPointMethod : method,
|
||||
kStatRoutingMode : (isOnRoute ? kStatRoutingModeOnRoute : kStatRoutingModePlanning)
|
||||
}];
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@interface MWMRouter ()<MWMLocationObserver, MWMFrameworkRouteBuilderObserver>
|
||||
|
||||
@property(nonatomic) NSMutableDictionary<NSValue *, NSData *> * altitudeImagesData;
|
||||
@property(nonatomic) NSString * altitudeElevation;
|
||||
@property(nonatomic) dispatch_queue_t renderAltitudeImagesQueue;
|
||||
@property(nonatomic) uint32_t taxiRoutePointTransactionId;
|
||||
@property(nonatomic) uint32_t routeManagerTransactionId;
|
||||
@property(nonatomic) BOOL canAutoAddLastLocation;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMRouter
|
||||
|
||||
+ (MWMRouter *)router
|
||||
|
@ -350,8 +357,10 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType)
|
|||
if (!startPoint || !finishPoint)
|
||||
return;
|
||||
|
||||
[MWMRouter router].isAPICall = YES;
|
||||
[self addPoint:startPoint];
|
||||
[self addPoint:finishPoint];
|
||||
[MWMRouter router].isAPICall = NO;
|
||||
|
||||
[self rebuildWithBestRouter:bestRouter];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue