Documentation for maplib/Track.kt

data class TrackInfo

Track information class.

fun constructor(name: String, start: Date, stop: Date, count: Long)

Main constructor

Параметры
  • name – e Track name

  • start – t Track start date

  • stop – p Track stop date

  • count – t Track points count

val name : String

e Track name

val start : Date

t Track start date

val stop : Date

p Track stop date

val count : Long

t Track points count

data class Location

GPS location class.

fun constructor(longitude: Double, latitude: Double, altitude: Double, accuracy: Float, speed: Float, course: Float, time: Long, provider: String, bearing: Float, satelliteCount: Int)

Main constructor

Параметры
  • longitude – e Longitude of location.

  • latitude – e Latitude of location.

  • altitude – e Altitude of location.

  • accuracy – y Accuracy.

  • speed – d Speed at point.

  • time – e Timestamp.

  • satelliteCount – t Satellite count.

val longitude : Double

e Longitude of location.

val latitude : Double

e Latitude of location.

val altitude : Double

e Altitude of location.

val accuracy : Float

y Accuracy.

val speed : Float

d Speed at point.

val time : Long

e Timestamp.

val satelliteCount : Int

t Satellite count.

class Track

Track. GPS Track class.

fun constructor(handle: Long)

Main constructor

static fun getId(regenerate: Boolean = false) : String

Get tracker identifier.

Параметры
  • regenerate – If true, the new identifier will be generated.

Результат

String with tracker identifier.

static fun isRegistered() : Boolean

Is current tracker identifier registered at NextGIS Tracker Hub.

Результат

true if registered at NextGIS Tracker Hub.

val count : Long

Track count readonly property.

fun sync()

Sync coordinates with NextGIS tracker service.

fun getTracks() : Array<TrackInfo>

Get available tracks list.

Результат

Array of tracks information.

fun export(start: Date, stop: Date, name: String, destination: Object, callback: ((status: StatusCode, complete: Double, message: String) -> Boolean)? = null) : Boolean

Export track to GPX

Параметры
  • start – Track start date.

  • stop – Track stop date.

  • name – GPX file name.

  • destination – Destination path (must be folder)

  • callback – Export progress

Результат

True on success.

fun addPoint(name: String, location: Location, startTrack: Boolean, startSegment: Boolean) : Boolean

Add new point to current track

Параметры
  • name – Track name

  • location – Point coordinates and other options

  • startTrack – Is this new point starts new track

  • startSegment – Is this point starts new track segment

Результат

True on success.

fun deletePoints(start: Date, stop: Date) : Boolean

Delete points from start to stop time

Параметры
  • start – Start timestamp to delete points

  • stop – Stop timestamp to delete points

Результат

True on success.