getTimeDistance method
Returns time and distance metrics for the route or a segment.
When called on a route, returns aggregated metrics (total distance and estimated travel time). When called on a segment (via the corresponding API), the segment's metrics are returned.
Parameters
activePart: Iftrue, consider only the active portion of the route; otherwise return metrics for the entire route. Defaults totrue.
Returns
- A TimeDistance object containing distance (meters) and time (seconds) information.
Implementation
TimeDistance getTimeDistance({final bool activePart = true}) {
final OperationResult resultString = objectMethod(
pointerId,
'RouteBase',
'getTimeDistance',
args: activePart,
);
return TimeDistance.fromJson(resultString['result']);
}