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

Decode polyline6 #281

Merged
merged 4 commits into from
Jun 25, 2018
Merged

Decode polyline6 #281

merged 4 commits into from
Jun 25, 2018

Conversation

frederoni
Copy link
Contributor

@frederoni frederoni commented Jun 21, 2018

We're decoding a geometry string as polyline even if we specify polyline6 in the route options.

@bsudekum @1ec5

@@ -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
Copy link
Contributor Author

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?

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.

Copy link
Contributor Author

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. 🤔

@frederoni
Copy link
Contributor Author

Ready for review

@frederoni frederoni merged commit a8c9300 into master Jun 25, 2018
@frederoni frederoni deleted the polyline6 branch June 25, 2018 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants