getCoordinatesAtPercent static method

Coordinates getCoordinatesAtPercent(
  1. List<Coordinates> coords,
  2. double percent
)

Get a coordinate along the path given by a fraction of the path length between 0.0 (departure point) and 1.0 (destination).

Calculates the Coordinates at the given percent along a path described by coords. The percent is a fraction in the range 0.0..1.0 where 0.0 represents the path start and 1.0 the path end.

Parameters

  • coords: The list of Coordinates that define the path geometry.
  • percent: A double in the range 0.0..1.0 indicating the position along the path.

Returns

  • The interpolated Coordinates at the requested percentage of the path.

Implementation

static Coordinates getCoordinatesAtPercent(
  final List<Coordinates> coords,
  final double percent,
) {
  final OperationResult resultString = staticMethod(
    'Path',
    'getCoordinatesAtPercent',
    args: <String, Object>{'coords': coords, 'percent': percent},
  );

  return Coordinates.fromJson(resultString['result']);
}