-
Notifications
You must be signed in to change notification settings - Fork 322
Changes to adopt the named arrival instructions from Directions API #1406
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
Conversation
…now provide waypoint arrival name(s).
@vincethecoder I think there maybe a couple more additions needed here
|
|
@@ -83,7 +83,7 @@ open class ManeuverView: UIView { | |||
ManeuversStyleKit.drawFork(frame: bounds, resizing: resizing, primaryColor: primaryColor, secondaryColor: secondaryColor) | |||
flip = [.left, .slightLeft, .sharpLeft].contains(direction) | |||
case .takeRoundabout, .turnAtRoundabout, .takeRotary: | |||
ManeuversStyleKit.drawRoundabout(frame: bounds, resizing: resizing, primaryColor: primaryColor, secondaryColor: secondaryColor, roundabout_angle: CGFloat(visualInstruction.primaryInstruction.degrees)) | |||
ManeuversStyleKit.drawRoundabout(frame: bounds, resizing: resizing, primaryColor: primaryColor, secondaryColor: secondaryColor, roundabout_angle: CGFloat(visualInstruction.primaryInstruction.finalHeading)) |
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.
I think this change should be reverted, degrees is specific to roundabouts.
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.
This is a temporary change, as The current master copy of MapboxDirections.swift is missing degrees
. Had to use finalHeading
till we publish the changes which has the degrees
field.
https://github.com/mapbox/MapboxDirections.swift/blob/master/MapboxDirections/MBVisualInstruction.swift#L38
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.
Oh wow, indeed it was renamed mapbox/mapbox-directions-swift@03979d6
Examples/Swift/ViewController.swift
Outdated
let coordinates = mapView.convert(tap.location(in: mapView), toCoordinateFrom: mapView) | ||
let waypoint = Waypoint(coordinate: coordinates) | ||
let waypoint = Waypoint(coordinate: coordinates, name: destinationName) |
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.
Want to use waypoints.count
here to show this can change for a multi-waypoint route?
Examples/Swift/ViewController.swift
Outdated
@@ -154,8 +154,9 @@ class ViewController: UIViewController, MGLMapViewDelegate, CLLocationManagerDel | |||
multipleStopsAction.isEnabled = false | |||
} | |||
|
|||
let destinationName = "Dropped Pin #\(waypoints.endIndex + 1)" // Note you can change this. This will be used in the top banner |
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.
This will be used in the top banner
to
This will be used in the top banner when arriving at a destination.
@vincethecoder MapboxDirections.swift v0.21.0 has been released. Don't forget to update the appropriate podspec files as well. |
Don't forget to also update MapboxCoreNavigation.podspec. |
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.
Looks good to me, let's hold off on merging this until v0.17.0 is out.
Since Directions API will be providing waypoint arrival instructions, we decided to delete the special case for arrival banners.
Closes #1123
TODO:
/cc @1ec5 @bsudekum