MapboxDistanceUtil
A utility for rounding distances for displaying in view components.
Functions
Link copied to clipboard
fun formatDistance( distanceInMeters: Double, roundingIncrement: Int, unitType: UnitType): Double
Content copied to clipboard
fun formatDistance( distanceInMeters: Double, roundingIncrement: Int, unitType: UnitType, context: Context): FormattedDistanceData
Content copied to clipboard
fun formatDistance( distanceInMeters: Double, roundingIncrement: Int, unitType: UnitType, context: Context, locale: Locale): FormattedDistanceData
Content copied to clipboard
This will recalculate and format a distance based on the parameters inputted. The value will be rounded for visual display and a distance suffix like 'km' for kilometers or 'ft' for foot/feet will be included.