forked from organicmaps/organicmaps
[ios] Added logging when taxi routing starts.
This commit is contained in:
parent
156d40a2f7
commit
a85cd17c3e
4 changed files with 28 additions and 5 deletions
|
@ -306,7 +306,9 @@ using TInfoDisplays = NSHashTable<__kindof TInfoDisplay>;
|
|||
- (void)addInfoDisplay:(TInfoDisplay)infoDisplay { [self.infoDisplays addObject:infoDisplay]; }
|
||||
- (NSString *)startButtonTitle
|
||||
{
|
||||
return [MWMRouter isTaxi] ? L(@"taxi_order") : L(@"p2p_start");
|
||||
if (![MWMRouter isTaxi])
|
||||
return L(@"p2p_start");
|
||||
return self.taxiDataSource.isTaxiInstalled ? L(@"taxi_order") : L(@"taxi_install");
|
||||
}
|
||||
#pragma mark - Properties
|
||||
|
||||
|
|
|
@ -17,5 +17,6 @@ class MWMRoutePoint;
|
|||
failure:(MWMStringBlock)failure;
|
||||
|
||||
- (NSURL *)taxiURL;
|
||||
- (BOOL)isTaxiInstalled;
|
||||
|
||||
@end
|
||||
|
|
|
@ -63,10 +63,24 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi
|
|||
+ (BOOL)isTaxi { return GetFramework().GetRouter() == routing::RouterType::Taxi; }
|
||||
+ (void)startRouting
|
||||
{
|
||||
if ([self isTaxi])
|
||||
[[UIApplication sharedApplication] openURL:[MWMNavigationDashboardManager manager].taxiDataSource.taxiURL];
|
||||
else
|
||||
[[self router] start];
|
||||
auto router = [MWMRouter router];
|
||||
if (![self isTaxi])
|
||||
{
|
||||
[router start];
|
||||
return;
|
||||
}
|
||||
|
||||
auto taxiDataSource = [MWMNavigationDashboardManager manager].taxiDataSource;
|
||||
auto eventName = taxiDataSource.isTaxiInstalled ? kStatRoutingTaxiOrder : kStatRoutingTaxiInstall;
|
||||
auto const & sLatLon = MercatorBounds::ToLatLon(router.startPoint.Point());
|
||||
auto const & fLatLon = MercatorBounds::ToLatLon(router.finishPoint.Point());
|
||||
|
||||
[Statistics logEvent:eventName
|
||||
withParameters:@{kStatProvider : kStatUber, kStatFromLat : @(sLatLon.lat), kStatFromLon : @(sLatLon.lon),
|
||||
kStatToLat : @(fLatLon.lat), kStatToLon : @(fLatLon.lon)}
|
||||
atLocation:[MWMLocationManager lastLocation]];
|
||||
|
||||
[[UIApplication sharedApplication] openURL:taxiDataSource.taxiURL];
|
||||
}
|
||||
|
||||
- (instancetype)initRouter
|
||||
|
|
|
@ -97,6 +97,8 @@ static NSString * const kStatExport = @"Export";
|
|||
static NSString * const kStatFacebook = @"Facebook";
|
||||
static NSString * const kStatFeedback = @"Feedback";
|
||||
static NSString * const kStatFrom = @"from";
|
||||
static NSString * const kStatFromLat = @"from_lat";
|
||||
static NSString * const kStatFromLon = @"from_lon";
|
||||
static NSString * const kStatFromMyPosition = @"From my position";
|
||||
static NSString * const kStatGo = @"Go";
|
||||
static NSString * const kStatGoogle = @"Google";
|
||||
|
@ -172,6 +174,8 @@ static NSString * const kStatRestaurantLat = @"restaurant_lat";
|
|||
static NSString * const kStatRestaurantLon = @"restaurant_lon";
|
||||
static NSString * const kStatRetry = @"retry";
|
||||
static NSString * const kStatRouting = @"routing";
|
||||
static NSString * const kStatRoutingTaxiInstall = @"Routing_Taxi_install";
|
||||
static NSString * const kStatRoutingTaxiOrder = @"Routing_Taxi_order";
|
||||
static NSString * const kStatSave = @"Save";
|
||||
static NSString * const kStatScenario = @"scenario";
|
||||
static NSString * const kStatScreen = @"Screen";
|
||||
|
@ -194,6 +198,8 @@ static NSString * const kStatSwapRoutingPoints = @"Swap routing points";
|
|||
static NSString * const kStatTTS = @"TTS";
|
||||
static NSString * const kStatTTSSettings = @"TTS settings";
|
||||
static NSString * const kStatTable = @"Table";
|
||||
static NSString * const kStatToLat = @"to_lat";
|
||||
static NSString * const kStatToLon = @"to_lon";
|
||||
static NSString * const kStatToMyPosition = @"To my position";
|
||||
static NSString * const kStatToggleBookmark = @"Toggle bookmark";
|
||||
static NSString * const kStatToggleCompassCalibration = @"Toggle compass calibration";
|
||||
|
|
Loading…
Add table
Reference in a new issue