diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-03-24 12:29:45 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-03-24 12:29:45 +0530 |
commit | 85fa5aed51ee16a7f5258ab29a991c9e4007fc04 (patch) | |
tree | 32e9b2633bfd1869689c6e7f96baadd7f85e4980 /modern/src/reports | |
parent | 5b9f7db4f18d79570fa17bd61b82eec4452c2aa8 (diff) | |
download | trackermap-web-85fa5aed51ee16a7f5258ab29a991c9e4007fc04.tar.gz trackermap-web-85fa5aed51ee16a7f5258ab29a991c9e4007fc04.tar.bz2 trackermap-web-85fa5aed51ee16a7f5258ab29a991c9e4007fc04.zip |
Implementing coordinate formatting
Diffstat (limited to 'modern/src/reports')
-rw-r--r-- | modern/src/reports/RouteReportPage.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index 33ccb348..bbe37e2f 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -1,10 +1,10 @@ import React, { useState } from 'react'; import { DataGrid } from '@material-ui/data-grid'; import t from '../common/localization'; -import { formatPosition, formatDistance, formatSpeed, formatBoolean, formatDate, formatNumber } from '../common/formatter'; +import { formatDistance, formatSpeed, formatBoolean, formatDate, formatNumber, coordinateFormatter } from '../common/formatter'; import ReportFilter from './ReportFilter'; import ReportLayoutPage from './ReportLayoutPage'; -import { useAttributePreference } from '../common/preferences'; +import { useAttributePreference, usePreference } from '../common/preferences'; const Filter = ({ setItems }) => { @@ -29,6 +29,7 @@ const Filter = ({ setItems }) => { const RouteReportPage = () => { const distanceUnit = useAttributePreference('distanceUnit'); const speedUnit = useAttributePreference('speedUnit'); + const coordinateFormat = usePreference('coordinateFormat'); const columns = [{ headerName: t('positionFixTime'), @@ -41,13 +42,13 @@ const RouteReportPage = () => { field: 'latitude', type: 'number', flex: 1, - valueFormatter: ({ value }) => formatNumber(value, 5), + valueFormatter: ({ value }) => coordinateFormatter('latitude', value, coordinateFormat), }, { headerName: t('positionLongitude'), field: 'longitude', type: 'number', flex: 1, - valueFormatter: ({ value }) => formatNumber(value, 5), + valueFormatter: ({ value }) => coordinateFormatter('longitude', value, coordinateFormat), }, { headerName: t('positionSpeed'), field: 'speed', |