diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-05 16:43:42 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-05 16:43:42 -0700 |
commit | 8bde80a8cd1fb9b92f4867edbeeae48158f9036b (patch) | |
tree | 493edc77a38e4e39b438c4255a02cf843eedc821 /modern/src/common/components/PositionValue.js | |
parent | dad1892d4718f15c9ecdd301db140d66d52da6b3 (diff) | |
download | trackermap-web-8bde80a8cd1fb9b92f4867edbeeae48158f9036b.tar.gz trackermap-web-8bde80a8cd1fb9b92f4867edbeeae48158f9036b.tar.bz2 trackermap-web-8bde80a8cd1fb9b92f4867edbeeae48158f9036b.zip |
Configurable altitude units
Diffstat (limited to 'modern/src/common/components/PositionValue.js')
-rw-r--r-- | modern/src/common/components/PositionValue.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/common/components/PositionValue.js b/modern/src/common/components/PositionValue.js index 83fc0ef2..f80bc684 100644 --- a/modern/src/common/components/PositionValue.js +++ b/modern/src/common/components/PositionValue.js @@ -2,7 +2,7 @@ import React from 'react'; import { Link } from '@mui/material'; import { Link as RouterLink } from 'react-router-dom'; import { - formatAlarm, formatBoolean, formatCoordinate, formatCourse, formatDistance, formatNumber, formatPercentage, formatSpeed, formatTime, + formatAlarm, formatAltitude, formatBoolean, formatCoordinate, formatCourse, formatDistance, formatNumber, formatPercentage, formatSpeed, formatTime, } from '../util/formatter'; import { useAttributePreference, usePreference } from '../util/preferences'; import { useTranslation } from './LocalizationProvider'; @@ -18,6 +18,7 @@ const PositionValue = ({ position, property, attribute }) => { const value = property ? position[property] : position.attributes[attribute]; const distanceUnit = useAttributePreference('distanceUnit'); + const altitudeUnit = useAttributePreference('altitudeUnit'); const speedUnit = useAttributePreference('speedUnit'); const coordinateFormat = usePreference('coordinateFormat'); @@ -35,6 +36,8 @@ const PositionValue = ({ position, property, attribute }) => { return formatSpeed(value, speedUnit, t); case 'course': return formatCourse(value); + case 'altitude': + return formatAltitude(value, altitudeUnit, t); case 'batteryLevel': return formatPercentage(value); case 'alarm': |