aboutsummaryrefslogtreecommitdiff
path: root/web/app/AttributeFormatter.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-10-08 17:17:27 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-10-08 17:17:27 +1300
commit4966403aab46912dd29b8385b6050e95c47c295f (patch)
tree28b71a74e278274170fb7cbb13587f1fcd1dc26a /web/app/AttributeFormatter.js
parentfc408a9ad93ebef686453be0d6565a5e630bf476 (diff)
downloadetbsa-traccar-web-4966403aab46912dd29b8385b6050e95c47c295f.tar.gz
etbsa-traccar-web-4966403aab46912dd29b8385b6050e95c47c295f.tar.bz2
etbsa-traccar-web-4966403aab46912dd29b8385b6050e95c47c295f.zip
Add various coordinate formats
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r--web/app/AttributeFormatter.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index e206457..c319804 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') {