Open 1ec5 opened 6 years ago
What is the priority of this? It may not be realised that this has quite a high impact. For some reason, a lot of Map Matching requests that do not have any timestamps do not return any results. The same request with any random timestamps returns the expected route.
First of all, thank you for bringing up this issue in https://github.com/mapbox/mapbox-navigation-android/issues/875#issuecomment-421332368. It appears to have been an oversight. I’ve flagged this issue for the team to triage.
If you need a workaround in the meantime, you can subclass Directions and override the following method to manually add the semicolon-delimited timestamps
property according to this documentation.
It isn’t clear to me what should happen when one waypoint has a timestamp, and another does not.
There must be as many timestamps as there are request coordinates, each separated by ;
It sounds like we should fail hard if the timestamps are inconsistently annotated.
The Map Maching API has an optional
timestamps
query parameter. Currently, this library doesn’t offer a way to specify that parameter. Waypoint should have atimestamp
property (of type Date).MatchOptions.getter:params
should aggregate thetimestamp
s of the waypoints into thetimestamps
parameter.In https://github.com/mapbox/MapboxDirections.swift/pull/236#discussion_r172037100, I had suggested relying on
CLLocation.timestamp
, but it turns out that Waypoint stores coordinates and headings separately, not as part of a location. That should change, though not necessarily as part of fixing this omission.It isn’t clear to me what should happen when one waypoint has a timestamp and another does not. Maybe this semicolon-delimited list can contain blank entries.
/ref https://github.com/mapbox/mapbox-navigation-android/issues/875#issuecomment-421332368 /cc @frederoni