diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-10-08 17:17:27 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-10-08 17:17:27 +1300 |
commit | 4966403aab46912dd29b8385b6050e95c47c295f (patch) | |
tree | 28b71a74e278274170fb7cbb13587f1fcd1dc26a /web/app/AttributeFormatter.js | |
parent | fc408a9ad93ebef686453be0d6565a5e630bf476 (diff) | |
download | trackermap-web-4966403aab46912dd29b8385b6050e95c47c295f.tar.gz trackermap-web-4966403aab46912dd29b8385b6050e95c47c295f.tar.bz2 trackermap-web-4966403aab46912dd29b8385b6050e95c47c295f.zip |
Add various coordinate formats
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r-- | web/app/AttributeFormatter.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index e2064573..c3198048 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,8 @@ Ext.define('Traccar.AttributeFormatter', { singleton: true, - coordinateFormatter: function (value) { - return value.toFixed(Traccar.Style.coordinatePrecision); + coordinateFormatter: function (key, value) { + return Ext.getStore('CoordinateFormats').formatValue(key, value, Traccar.app.getPreference('coordinateFormat')); }, speedFormatter: function (value) { @@ -63,8 +63,11 @@ Ext.define('Traccar.AttributeFormatter', { }, getFormatter: function (key) { + var self = this; if (key === 'latitude' || key === 'longitude') { - return this.coordinateFormatter; + return function (value) { + return self.coordinateFormatter(key, value); + }; } else if (key === 'speed') { return this.speedFormatter; } else if (key === 'course') { |