getTimeDistanceCoordinates method
Build a timestamped list of coordinates sampled along the route.
Samples coordinates at regular intervals between start and end. The sampling interval is determined by
step and stepType (distance or time).
Parameters
start: Start distance from route start in meters.end: End distance from route start in meters.step: Step size (units determined bystepType).stepType: Unit used forstep— see StepType.
Returns
- A
List<TimeDistanceCoordinate>containing sampled coordinates with associated time/distance metadata.
Implementation
List<TimeDistanceCoordinate> getTimeDistanceCoordinates({
required final int start,
required final int end,
required final int step,
required final StepType stepType,
}) {
final OperationResult resultString = objectMethod(
pointerId,
'RouteBase',
'getTimeDistanceCoordinates',
args: <String, Object>{
'start': start,
'end': end,
'step': step,
'stepType': stepType == StepType.distance,
},
);
final List<dynamic> timeDistanceJson = resultString['result'];
return timeDistanceJson
.map((final dynamic e) => TimeDistanceCoordinate.fromJson(e))
.toList();
}