Documentation for maplib/Track.kt
- data class TrackInfo
Track information class.
- 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
- Parameters
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.
- class Track
Track. GPS Track class.
- static fun getId(regenerate: Boolean = false) : String
Get tracker identifier.
- Parameters
regenerate – If true, the new identifier will be generated.
- Returns
String with tracker identifier.
- static fun isRegistered() : Boolean
Is current tracker identifier registered at NextGIS Tracker Hub.
- Returns
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.
- Returns
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
- Parameters
start – Track start date.
stop – Track stop date.
name – GPX file name.
destination – Destination path (must be folder)
callback – Export progress
- Returns
True on success.
- fun addPoint(name: String, location: Location, startTrack: Boolean, startSegment: Boolean) : Boolean
Add new point to current track
- Parameters
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
- Returns
True on success.