[iOS] Removed taxi functions.

Signed-off-by: vng <viktor.govako@gmail.com>
This commit is contained in:
vng 2021-05-30 20:19:56 +03:00 committed by Roman Tsisyk
parent 3049bc0053
commit fcb57ffadf
6 changed files with 2 additions and 57 deletions

View file

@ -321,7 +321,6 @@ void setShowLocationAlert(BOOL needShow) {
case MWMRouterTypePublicTransport:
case MWMRouterTypePedestrian: manager.geoMode = GeoMode::PedestrianRouting; break;
case MWMRouterTypeBicycle: manager.geoMode = GeoMode::BicycleRouting; break;
case MWMRouterTypeTaxi: break;
}
}
else

View file

@ -25,7 +25,6 @@ using namespace routing;
@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;
@ -55,7 +54,6 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
switch ([self type]) {
case MWMRouterTypeVehicle:
case MWMRouterTypePublicTransport:
case MWMRouterTypeTaxi:
return NO;
case MWMRouterTypePedestrian:
case MWMRouterTypeBicycle:
@ -133,7 +131,6 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
if (self) {
self.altitudeImagesData = [@{} mutableCopy];
self.renderAltitudeImagesQueue = dispatch_queue_create(kRenderAltitudeImagesQueueLabel, DISPATCH_QUEUE_SERIAL);
self.taxiRoutePointTransactionId = RoutingManager::InvalidRoutePointsTransactionId();
self.routeManagerTransactionId = RoutingManager::InvalidRoutePointsTransactionId();
[MWMLocationManager addObserver:self];
[MWMFrameworkListener addObserver:self];
@ -158,39 +155,10 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
if (type == self.type)
return;
if (type == MWMRouterTypeTaxi)
[self openTaxiTransaction];
else
[self cancelTaxiTransaction];
[self doStop:NO];
GetFramework().GetRoutingManager().SetRouter(coreRouterType(type));
}
+ (void)openTaxiTransaction {
auto &rm = GetFramework().GetRoutingManager();
auto router = [MWMRouter router];
router.taxiRoutePointTransactionId = rm.OpenRoutePointsTransaction();
rm.RemoveIntermediateRoutePoints();
}
+ (void)cancelTaxiTransaction {
auto router = [MWMRouter router];
if (router.taxiRoutePointTransactionId != RoutingManager::InvalidRoutePointsTransactionId()) {
GetFramework().GetRoutingManager().CancelRoutePointsTransaction(router.taxiRoutePointTransactionId);
router.taxiRoutePointTransactionId = RoutingManager::InvalidRoutePointsTransactionId();
}
}
+ (void)applyTaxiTransaction {
// We have to apply taxi transaction each time we add/remove points after switch to taxi mode.
auto router = [MWMRouter router];
if (router.taxiRoutePointTransactionId != RoutingManager::InvalidRoutePointsTransactionId()) {
GetFramework().GetRoutingManager().ApplyRoutePointsTransaction(router.taxiRoutePointTransactionId);
router.taxiRoutePointTransactionId = RoutingManager::InvalidRoutePointsTransactionId();
}
}
+ (MWMRouterType)type {
return routerType(GetFramework().GetRoutingManager().GetRouter());
}
@ -220,7 +188,6 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
}
+ (void)removePoint:(MWMRoutePoint *)point {
[self applyTaxiTransaction];
RouteMarkData pt = point.routeMarkData;
GetFramework().GetRoutingManager().RemoveRoutePoint(pt.m_pointType, pt.m_intermediateIndex);
[[MWMNavigationDashboardManager sharedManager] onRoutePointsUpdated];
@ -241,7 +208,7 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
NSAssert(NO, @"Point can not be nil");
return;
}
[self applyTaxiTransaction];
RouteMarkData pt = point.routeMarkData;
GetFramework().GetRoutingManager().AddRoutePoint(std::move(pt));
[[MWMNavigationDashboardManager sharedManager] onRoutePointsUpdated];

View file

@ -2,6 +2,5 @@ typedef NS_ENUM(NSUInteger, MWMRouterType) {
MWMRouterTypeVehicle,
MWMRouterTypePedestrian,
MWMRouterTypePublicTransport,
MWMRouterTypeBicycle,
MWMRouterTypeTaxi
MWMRouterTypeBicycle
};

View file

@ -73,14 +73,6 @@ using namespace storage;
[self closePlacePage];
}
- (void)orderTaxi:(PlacePageData *)data
{
[MWMRouter setType:MWMRouterTypeTaxi];
MWMRoutePoint * point = [self routePointWithData:data pointType:MWMRoutePointTypeFinish intermediateIndex:0];
[MWMRouter buildToPoint:point bestRouter:NO];
[self closePlacePage];
}
- (MWMRoutePoint *)routePointWithData:(PlacePageData *)data
pointType:(MWMRoutePointType)type
intermediateIndex:(size_t)intermediateIndex

View file

@ -7,8 +7,6 @@
+ (void)editPlace;
+ (void)addBusiness;
+ (void)addPlace:(CLLocationCoordinate2D)coordinate;
+ (void)orderTaxi:(PlacePageData *)data;
+ (void)taxiShown:(PlacePageData *)data;
+ (void)openWebsite:(PlacePageData *)data;
+ (void)call:(PlacePageData *)data;
+ (void)showAllFacilities:(PlacePageData *)data;

View file

@ -14,8 +14,6 @@
- (void)editPlace;
- (void)addBusiness;
- (void)addPlace:(CLLocationCoordinate2D)coordinate;
- (void)orderTaxi:(PlacePageData *)data;
- (void)logTaxiShown:(PlacePageData *)data;
- (void)openWebsite:(PlacePageData *)data;
- (void)call:(PlacePageData *)data;
- (void)showAllFacilities:(PlacePageData *)data;
@ -62,14 +60,6 @@
[[MWMMapViewControlsManager manager].placePageManager addPlace:coordinate];
}
+ (void)orderTaxi:(PlacePageData *)data {
[[MWMMapViewControlsManager manager].placePageManager orderTaxi:data];
}
+ (void)taxiShown:(PlacePageData *)data {
[[MWMMapViewControlsManager manager].placePageManager logTaxiShown:data];
}
+ (void)openWebsite:(PlacePageData *)data {
[[MWMMapViewControlsManager manager].placePageManager openWebsite:data];
}