Skip to content
Select language:English

MDK 3.7.3

class Location(longitude: Double, latitude: Double, val timestamp: Long = -1, val level: Int = -1, val accuracy: Float = Float.NaN, val heightAboveSea: Float = Float.NaN, val heightAboveGround: Float = Float.NaN, val mode: LocationMode = LocationMode.Generic, val steps: Int = -1) : Coord2D

Represents a location reading with associated data.

This data class encapsulates the details of a location fix, including the timestamp, geographical coordinates, level, accuracy, and height information. It also includes the number of steps taken at the time of the location fix.

Parameters

longitude

The longitude of the location fix in degrees.

latitude

The latitude of the location fix in degrees.

Constructors

constructor(longitude: Double, latitude: Double, timestamp: Long = -1, level: Int = -1, accuracy: Float = Float.NaN, heightAboveSea: Float = Float.NaN, heightAboveGround: Float = Float.NaN, mode: LocationMode = LocationMode.Generic, steps: Int = -1)

Properties

The estimated accuracy of the location fix in meters. If not provided, it defaults to Float.NaN.

The height above ground level at the location fix in meters. If not provided, it defaults to Float.NaN.

The height above sea level at the location fix in meters. If not provided, it defaults to Float.NaN.

val level: Int

The level or floor associated with the location fix. If not provided, it defaults to -1.

The mode of the location fix. If not provided, it defaults to LocationMode.Generic.

val steps: Int

The number of steps taken at the time of the location fix. If not provided, it defaults to -1.

The timestamp of the location fix in milliseconds. If not provided, it defaults to -1.

Inherited properties

Inherited functions

fun distanceTo(coord: Coord2D): Double
fun distanceTo(longitude: Double, latitude: Double): Double
fun getBoundingBox(size: Double): Pair<Coord2D, Coord2D>
fun getBoundingBox(width: Double, height: Double): Pair<Coord2D, Coord2D>
fun move(east: Double, north: Double): Coord2D