-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose offline routing functionality to Obj-C #1891
Conversation
coordinates = @[[NSValue valueWithMKCoordinate:CLLocationCoordinate2DMake(0, 0)], | ||
[NSValue valueWithMKCoordinate:CLLocationCoordinate2DMake(1, 1)]]; | ||
|
||
MBCoordinateBounds *bounds = [[MBCoordinateBounds alloc] init:coordinates]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init
should be refined for Obj-C
@@ -89,7 +89,7 @@ public class NavigationDirections: Directions { | |||
- parameter progressHandler: Unpacking reports progress every 500ms. | |||
- parameter completionHandler: Called when unpacking completed. | |||
*/ | |||
public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) { | |||
@objc public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@objc public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) { | |
@objc(unpackTilePackAtURL:outputDirectoryURL:progressHandler:completionHandler:) | |
public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion for the changelog:
- The
NavigationDirections.unpackTilePack(at:outputDirectoryURL:progressHandler:completionHandler:)
method is now available to Objective-C code as-[MBNavigationDirections unpackTilePackAtURL:outputDirectoryURL:progressHandler:completionHandler:]
. (#1891)
@@ -41,6 +42,43 @@ - (void)testUpdateRoute { | |||
_routeController.routeProgress = [[MBRouteProgress alloc] initWithRoute:route legIndex:0 spokenInstructionIndex:0]; | |||
[self waitForExpectations:@[expectation] timeout:5]; | |||
} | |||
|
|||
// This test is excluded from the test suite. We are just verifying that offline routing bridges to Obj-C at compile time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we excluding it because the networking is currently unstubbed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, kind of. These tests are just to make sure we don't regress Obj-C bridging.
We have offline tests for fetching available versions, downloading tiles, and unpacking tiles written in Swift with stubbed network.
Tail work from #1808 , offline routing now bridges to Obj-C.
cc @1ec5 @JThramer