-
Notifications
You must be signed in to change notification settings - Fork 14
Formatting units
Locus API allows to format units for users, based on it's settings in Locus application itself.
For this you need LocusInfo
object. How to get it read here.
LocusInfo
contains all necessary parameters for formatting units, available under getUnitsFormatX()
functions. Currently supported are units for altitude, angle, area, energy, length, slope, speed, temperature and weight.
Received values are constants defined in UtilsFormat
class.
We know user's defined parameters and we have our new favorite UtilsFormat
class, so let's start.
Every unit has three main functions. Let's show it on Altitude value as a sample.
-
formatAltitude(int format, double altitude, boolean addUnits)
is main formatting function for formatting altitude values. Format parameter is value received fromLocusInfo
object, altitude is value in metres we wants to format and last flag just define if we wants to attach units to final number. -
formatAltitudeValue(int format, double altitude)
then serve for formatting of value itself. More precisely it convert metres to any other units. -
formatAltitudeUnits
has simple purpose of getting an units for certain format
All other units has similarly named functions, that may be used for formatting values in same format as user defined in core application itself.
-
Basics
-
Non-API tools
-
Using API
-
Work with points
-
Work with tracks
-
Integration into Locus Map
-
Other/advanced features