-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add support for speed limits via maxspeed annotations. #367
Conversation
This is a revival of #250. |
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.
Thanks! In addition to the feedback below, would you do the honors and add a changelog entry?
MapboxDirections/MBSpeedLimit.swift
Outdated
/** | ||
Indicates the road segment uses kilometers per hour for measuring speed limits. | ||
*/ | ||
case kilometersPerHour |
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.
Argh, it would be great if we could just use Measurement
along with UnitSpeed.kilometersPerHour
, but alas we still support iOS 9.0 (along with macOS 10.11.0, tvOS 9.0, and watchOS 2.0). I’m chomping at the bit to drop iOS 9 support.
/cc @mapbox/navigation-ios
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.
A proposed change to the Directions API would add information about locally relevant units to each step, making this class somewhat redundant. We could store the speed limit annotations as CLLocationSpeed
s (converting everything to meters per second). Then client code could losslessly convert back to kilometers per hour or miles per hour as indicated by the step.
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.
A few nits, but this looks good. Note that we probably shouldn’t merge this PR until we’re ready to mention the new annotation type in the official Directions API documentation.
01a7be6
to
4682568
Compare
I revived #250 and rebased and retargeted this PR atop it, because that PR already had tests and handled Autobahns correctly. |
4682568
to
d723ec9
Compare
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.
Going to handle #367 (comment) and #367 (comment) as to-do items for landing #250.
Include SDK/API support for speed limits from the Directions API via the maxspeed annotations in the directions response.