distance method

  1. @override
double distance(
  1. dynamic position,
  2. dynamic destination, {
  3. LengthUnit unit = LengthUnit.M,
})
override

Computes the distance between two points.

Implementation

@override
double distance(dynamic position, dynamic destination,
    {LengthUnit unit = LengthUnit.M}) {
  position = LatLng.from(position);
  destination = LatLng.from(destination);
  double distance = algorithm.distance(position, destination);
  return _round(LengthUnit.M.to(unit, distance));
}