destination method
LatLng
destination(
- double distance,
- double bearing, {
- DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
override
Calculate LatLng destination with distance
and bearing
from current center of the map.
distance
distance to be used to calculate LatLang destination
bearing
bearing to be used to calculate LatLang destination
algorithm
calculation algorithm to be used.
Available values DistanceAlgorithmType.Haversine and
DistanceAlgorithmType.Vincenty
Default [DistanceAlgorithmType.Haversine]
Implementation
@override
LatLng destination(
double distance,
double bearing, {
DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
}) {
bool isVincenty = algorithm == DistanceAlgorithmType.Vincenty;
Distance d = isVincenty ? DistanceVincenty() : DistanceHaversine();
return d.offset(map?.center, distance, bearing);
}