medyas / flutter_qiblah

Flutter Qiblah is a plugin that allows you to display Qiblah direction in you app with support for both Android and iOS.
https://pub.dev/packages/flutter_qiblah
MIT License
134 stars 97 forks source link

Added geodesic #45

Closed sagynbek closed 6 months ago

sagynbek commented 7 months ago

It used to draw direct shortest path from current location to Mecca location. Setting geodesic to true fixes the issue. Definition of Geodesic

  /// Indicates whether the segments of the polyline should be drawn as geodesics, as opposed to straight lines
  /// on the Mercator projection.
  ///
  /// A geodesic is the shortest path between two points on the Earth's surface.
  /// The geodesic curve is constructed assuming the Earth is a sphere

Below is the example from Toronto/Canada

Before

Screenshot 2024-02-06 at 21 55 53 Screenshot 2024-02-06 at 21 56 11

After

Screenshot 2024-02-06 at 21 54 38 Screenshot 2024-02-06 at 21 54 59