LocationUtils class final

Available extensions

Constructors

LocationUtils.new()
The singleton instance of this package.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
instance LocationUtils
The singleton instance of this package.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateBestCenter({required Set<TLocationComponents> locations, required double threshold, required DistanceUnit distanceUnit}) TLocationComponents

Available on LocationUtils, provided by the CalculateBestCentereOnLocationPackageExtension extension

Calculates the best center for a set of locations. This is the geometric center unless the distance to the closest marker is greater than the threshold, then the closest marker is used. The distanceUnit is the unit of the threshold.
calculateGeometricCenter(Set<TLocationComponents> locations) TLocationComponents

Available on LocationUtils, provided by the CalculateGeometricCentereOnLocationPackageExtension extension

Calculates the geometric center of a set of locations.
calculateHavershire3DDistance({required TLocationComponents location1, required TLocationComponents location2, DistanceUnit unit = DistanceUnit.METRES, CelestialRadius radius = CelestialRadius.EARTH}) double

Available on LocationUtils, provided by the CalculateHavershire3DDistanceOnLocationPackageExtension extension

Calculate the distance between two locations using the Haversine formula and optionally the elevation difference.
calculateZoomToFit(Iterable<TLocationComponents> locations, {double factor = 1.0, double minZoom = 10.0, double maxZoom = 20.0}) double

Available on LocationUtils, provided by the CalculateZoomToFitOnLocationPackageExtension extension

Calculates the zoom level to fit all the locations on a map. The factor is a multiplier to adjust the zoom level. The minZoom and maxZoom are the minimum and maximum zoom levels to clamp the result.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

DISTANCE_ASTRONOMICAL_UNITS → const DistanceUnit
The distance unit of astronomical units.
DISTANCE_FEET → const DistanceUnit
The distance unit of feet.
DISTANCE_KILOMETRES → const DistanceUnit
The distance unit of kilometres.
DISTANCE_METRES → const DistanceUnit
The distance unit of metres.
DISTANCE_MILES → const DistanceUnit
The distance unit of miles.
DISTANCE_NAUTICAL_MILES → const DistanceUnit
The distance unit of nautical miles.
DISTANCE_YARDS → const DistanceUnit
The distance unit of yards.
RADIUS_EARTH → const CelestialRadius
The radius of the Earth.
RADIUS_EARTH_MOON → const CelestialRadius
The radius of the Moon.
RADIUS_MARS → const CelestialRadius
The radius of Mars.