isInsideRadius method
bool
isInsideRadius(
- LatLng location,
- double radius, {
- DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
- LengthUnit unit = LengthUnit.M,
override
Check if a specific location
is inside the radius from
current center of the map.
location
the location to be checked whether it's within a radius
radius
the radius to be used to check
algorithm
algorithm to be used.
Available values DistanceAlgorithmType.Haversine and
DistanceAlgorithmType.Vincenty
Default [DistanceAlgorithmType.Haversine]
unit
unit of radius
. Default in meters LengthUnit.M
Implementation
@override
bool isInsideRadius(
LatLng location,
double radius, {
DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
LengthUnit unit = LengthUnit.M,
}) {
double distance = this.distance(location, algorithm: algorithm, unit: unit);
return distance <= radius;
}