distanceToDestination property

int get distanceToDestination

Distance (in meters) from the event position on the current route to the destination.

This value is route-specific and therefore only available for events that are part of a computed Route.

When no route context is available the SDK returns 0.

Returns

  • int: distance in meters to destination, or 0 when unavailable.

Implementation

int get distanceToDestination {
  final OperationResult resultString = objectMethod(
    pointerId,
    'RouteTrafficEvent',
    'getDistanceToDestination',
  );

  return resultString['result'];
}