Conversation
How urgent is this fix? Can we wait until the fix lands in the Directions API? /cc @ericrwolfe |
|
It's been in this long already now. I think we can wait for an upstream fix. |
|
I think if we can fix this now, we should. Once it's fixed upstream, the code path won't even be hit. It's very harmless code. |
|
removed hack. OSRM fix should be 1-2 weeks out. |
| guard let snappedCoordinate = closestCoordinate(on: stepCoordinates, to: location.coordinate) else { return location } | ||
|
|
||
| let nearByCoordinates = routeProgress.currentLegProgress.nearbyCoordinates | ||
| var nearByCoordinates = routeProgress.currentLegProgress.currentAndUpcomgingStepCoordinates |
There was a problem hiding this comment.
Maybe this should remain nearbyCoordinates? Although I cant think of any reason to know about the previous step coords
There was a problem hiding this comment.
At a glance, I can’t think of any reason it would make a difference whether we include the previous coordinates or not.
| /** | ||
| Returns an array of `CLLocationCoordinate2D` of the current and upcoming step geometry. | ||
| */ | ||
| public var currentAndUpcomgingStepCoordinates: [CLLocationCoordinate2D] { |
| public var currentAndUpcomgingStepCoordinates: [CLLocationCoordinate2D] { | ||
| let upcomingCoords = upComingStep?.coordinates ?? [] | ||
| let currentCoords = currentStep.coordinates ?? [] | ||
| let nearby = currentCoords + upcomingCoords |
There was a problem hiding this comment.
Is a separate method really needed to concatenate these two arrays, given that there’s only one call site?
|
@1ec5 fixed. |
Closes: #639
This addresses two issues:
/cc @danpat @1ec5 @frederoni