offset method

  1. @override
LatLng offset(
  1. dynamic from,
  2. double? distanceInMeter,
  3. double bearing
)
override

Returns a destination point based on the given distance and bearing

Given a from (start) point, initial bearing, and distance, this will calculate the destination point and final bearing travelling along a (shortest distance) great circle arc.

final Distance distance = const Distance();

final num distanceInMeter = (EARTH_RADIUS * math.PI / 4).round();

final p1 = new LatLng(0.0, 0.0);
final p2 = distance.offset(p1, distanceInMeter, 180);

Bearing: Left - 270°, right - 90°, up - 0°, down - 180°

Implementation

@override
LatLng offset(
  dynamic from,
  double? distanceInMeter,
  double bearing,
) =>
    algorithm.offset(
      LatLng.from(from),
      distanceInMeter,
      bearing,
    );