mapbox / mapbox/mapbox-navigation-ios
NavigationMatchOptions should not clear out coordinate accuracies
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
`NavigationMatchOptions(waypoints:profileIdentifier:)` clears out the `coordinateAccuracy` of any waypoint passed to it:
https://github.com/mapbox/mapbox-navigation-ios/blob/cddb733d99673a48ba442751865c20c6f5a1db4d/MapboxCoreNavigation/NavigationRouteOptions.swift#L78
I think the reason is that we expected these coordinates to come from a Core Location update’s `CLLocation.coordinateAccuracy`, which can be inaccurate or at least more conservative than what we’d generally need in a Map Matching API request. However, this is a public initializer, and it’s entirely possible for a developer to set `Waypoint.coordinateAccuracy` explicitly, only to see it silently unset, as in https://github.com/mapbox/MapboxDirections.swift/issues/321#issuecomment-443629473.
`NavigationMatchOptions(waypoints:profileIdentifier:)` should leave `coordinateAccuracy` alone. It should be up to the developer to unset `coordinateAccuracy` when calling `NavigationMatchOptions(locations:profileIdentifier:)` with a CLLocation from a Core Location update.
/cc @mapbox/navigation-ios
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review MapboxCoreNavigation/NavigationRouteOptions.swift around line 78 and trace NavigationMatchOptions(waypoints:profileIdentifier:). Verify the initializer's handling of Waypoint.coordinateAccuracy, then confirm completion by preserving explicitly provided accuracies while retaining the documented behavior for the CLLocation-based initializer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100