co-maps/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.mm

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
965 B
Text
Raw Normal View History

2025-11-22 13:58:55 +01:00
#import "DeepLinkRouteStrategyAdapter.h"
#import <CoreApi/Framework.h>
#import "MWMCoreRouterType.h"
#import "MWMRoutePoint+CPP.h"
@implementation DeepLinkRouteStrategyAdapter
- (instancetype)init:(NSURL *)url {
self = [super init];
if (self) {
auto const parsedData = GetFramework().GetParsedRoutingData();
auto const points = parsedData.m_points;
if (points.size() == 2) {
_p1 = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.front()
type:MWMRoutePointTypeStart
intermediateIndex:0];
_p2 = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.back()
type:MWMRoutePointTypeFinish
intermediateIndex:0];
_type = routerType(parsedData.m_type);
} else {
return nil;
}
}
return self;
}
@end