offset method

  1. @override
GeoLatLng offset(
  1. GeoLatLng from,
  2. num distanceInMeter,
  3. num 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
GeoLatLng offset(
        final GeoLatLng from, final num distanceInMeter, final num bearing) =>
    _calculator.offset(from, distanceInMeter.toDouble(), bearing.toDouble());