Skip to content
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

Distance to maneuver should be rounded in CarPlay #1857

Closed
1ec5 opened this issue Nov 23, 2018 · 0 comments
Closed

Distance to maneuver should be rounded in CarPlay #1857

1ec5 opened this issue Nov 23, 2018 · 0 comments
Labels
bug Something isn’t working CarPlay Bugs, improvements and feature requests on Apple CarPlay
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 23, 2018

Distances shown in CarPlay’s maneuver panel aren’t rounded as they are inside NavigationViewController.

de anza

RoundingTable.threshold(for:) is getting called, and DistanceFormatter.measurement(of:) even sets NumberFormatter.roundingIncrement before calling Threshold.measurement(for:), but Threshold.measurement(for:) doesn’t use the number formatter and doesn’t perform any rounding when creating the Measurement:

numberFormatter.roundingIncrement = threshold.roundingIncrement as NSNumber
return Measurement(value: distance.miles, unit: .miles)

Threshold.roundingIncrement can be readily plugged into the Double.rounded(to:) method shown in mapbox/mapbox-directions-swift#311 (comment).

/ref #1853
/cc @mapbox/navigation-ios

@1ec5 1ec5 added bug Something isn’t working CarPlay Bugs, improvements and feature requests on Apple CarPlay labels Nov 23, 2018
@akitchen akitchen added this to the v0.27.0 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working CarPlay Bugs, improvements and feature requests on Apple CarPlay
Projects
None yet
Development

No branches or pull requests

2 participants