bearing method

  1. @override
double bearing(
  1. dynamic toDestination, {
  2. DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
})
override

Calculate bearing from current center of the map to toDestination.

toDestination the destination location to calculate the bearing algorithm calculation algorithm to be used. Available values DistanceAlgorithmType.Haversine and DistanceAlgorithmType.Vincenty

        Default [DistanceAlgorithmType.Haversine]

Implementation

@override
double bearing(
  dynamic toDestination, {
  DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
}) {
  bool isVincenty = algorithm == DistanceAlgorithmType.Vincenty;
  Distance d = isVincenty ? DistanceVincenty() : DistanceHaversine();
  return d.bearing(map?.center, toDestination);
}