feat: Speed mapping

This commit is contained in:
Piotr Dec 2024-08-02 01:53:32 +02:00
parent 85e4fdb858
commit 30dc5c623e
Signed by: stawros
GPG key ID: F89F27AD8F881A91

View file

@ -103,10 +103,12 @@ class MapboxMapper {
return Lanes(Arrows(lanes), Arrows(outlines))
}
fun map(locationMatcherResult: LocationMatcherResult): GarminLocation {
val state = GarminLocation()
// TODO: speed, limit, location?, bearing
return state
fun asSpeed(locationMatcherResult: LocationMatcherResult): Speed {
return Speed(
locationMatcherResult.enhancedLocation.speed.let { it?.toInt() ?: 0 },
locationMatcherResult.speedLimitInfo.speed.let { it ?: 0 },
)
}
}