Location class

A data class representing a geographic location.

A location can consist of a latitude, longitude, timestamp, and other information such as bearing, altitude and velocity.

See: https://developer.android.com/reference/android/location/Location See: https://github.com/aosp-mirror/platform_frameworks_base/blob/master/location/java/android/location/Location.java

Mixed in types

Constructors

Location(double latitude, double longitude, {double accuracy, double altitude, double bearing, double bearingAccuracyDegrees, int elapsedRealtimeNanos, Bundle extras, String provider, double speed, double speedAccuracyMetersPerSecond, int time, double verticalAccuracyMeters})

Properties

accuracy double
See: https://developer.android.com/reference/android/location/Location#CREATOR The estimated horizontal accuracy of this location, radial, in meters. [...]
final
altitude double
The altitude if available, in meters above the WGS 84 reference ellipsoid [...]
final
bearing double
The bearing, in degrees. [...]
final
bearingAccuracyDegrees double
The estimated bearing accuracy of this location, in degrees. [...]
final
elapsedRealtimeNanos int
The time of this fix, in elapsed real-time since system boot. [...]
final
extras Bundle
Any additional provider-specific information about the location fix. [...]
final
hasAccuracy bool
True if this location has a horizontal accuracy. [...]
read-only
hasAltitude bool
True if this location has an altitude. [...]
read-only
hasBearing bool
True if this location has a bearing. [...]
read-only
hasBearingAccuracy bool
True if this location has a bearing accuracy. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
hasSpeed bool
True if this location has a speed. [...]
read-only
hasSpeedAccuracy bool
True if this location fix has a speed accuracy. [...]
read-only
hasVerticalAccuracy bool
True if this location fix has a vertical accuracy. [...]
read-only
isFromMockProvider bool
True if this location fix came from a mock provider. [...]
read-only
latitude double
The latitude, in degrees. [...]
final
longitude double
The longitude, in degrees. [...]
final
parcelableCreator String
read-only, override
provider String
The name of the provider that generated this fix. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
speed double
The speed if it is available, in meters/second over ground. [...]
final
speedAccuracyMetersPerSecond double
The estimated speed accuracy of this location, in meters per second. [...]
final
time int
The UTC time of this fix, in milliseconds since January 1, 1970. [...]
final
verticalAccuracyMeters double
The estimated vertical accuracy of this location, in meters. [...]
final

Methods

describeContents() int
Describe any special objects contained in this instance's marshaled representation. [...]
inherited
distanceTo(Location dest) Future<double>
Returns the approximate distance in meters between this location and the given location. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
writeToParcel(Parcel parcel, [int flags = 0]) → void
Flatten this object in to a Parcel. [...]
override

Operators

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

Static Methods

distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) Future<double>
Computes the approximate distance in meters between two locations. [...]

Constants

FORMAT_DEGREES → const int
Constant used to specify formatting of a latitude or longitude in the form "+-DDD.DDDDD where D indicates degrees. [...]
0
FORMAT_MINUTES → const int
Constant used to specify formatting of a latitude or longitude in the form "+-DDD:MM.MMMMM" where D indicates degrees and M indicates minutes of arc (1 minute = 1/60th of a degree). [...]
1
FORMAT_SECONDS → const int
Constant used to specify formatting of a latitude or longitude in the form "DDD:MM:SS.SSSSS" where D indicates degrees, M indicates minutes of arc, and S indicates seconds of arc (1 minute = 1/60th of a degree, 1 second = 1/3600th of a degree). [...]
2