-
Notifications
You must be signed in to change notification settings - Fork 90
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
Decode polyline6 #281
Decode polyline6 #281
Conversation
MapboxDirections/MBRoute.swift
Outdated
@@ -38,7 +38,8 @@ open class Route: DirectionsResult { | |||
case let geometry as JSONDictionary: | |||
coordinates = CLLocationCoordinate2D.coordinates(geoJSON: geometry) | |||
case let geometry as String: | |||
coordinates = decodePolyline(geometry, precision: 1e5)! | |||
let precision = routeOptions.shapeFormat == .polyline ? 1e5 : 1e6 |
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.
Probably better to switch on routeOptions.shapeFormat
?
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.
Yeah, probably. Although the line above, case let geometry as String:
takes care of the case where it's geojson.
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.
We need to plumb this through MBRouteStep
as well. 🤔
Ready for review |
We're decoding a geometry string as
polyline
even if we specifypolyline6
in the route options.@bsudekum @1ec5