diff options
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/admin/ServerDialog.js | 8 | ||||
-rw-r--r-- | web/app/view/map/Map.js | 12 | ||||
-rw-r--r-- | web/app/view/map/MapController.js | 5 | ||||
-rw-r--r-- | web/app/view/state/StateController.js | 12 |
4 files changed, 28 insertions, 9 deletions
diff --git a/web/app/view/admin/ServerDialog.js b/web/app/view/admin/ServerDialog.js index 37bb498a0..080e2fcc4 100644 --- a/web/app/view/admin/ServerDialog.js +++ b/web/app/view/admin/ServerDialog.js @@ -43,6 +43,14 @@ Ext.define('Traccar.view.admin.ServerDialog', { displayField: 'name', valueField: 'key' }, { + xtype: 'textfield', + name: 'bingKey', + fieldLabel: strings.mapBingKey + }, { + xtype: 'textfield', + name: 'mapUrl', + fieldLabel: strings.mapCustom + }, { xtype: 'combobox', name: 'distanceUnit', fieldLabel: strings.settingsDistanceUnit, diff --git a/web/app/view/map/Map.js b/web/app/view/map/Map.js index 9d9a92886..cdb46342b 100644 --- a/web/app/view/map/Map.js +++ b/web/app/view/map/Map.js @@ -36,16 +36,20 @@ Ext.define('Traccar.view.map.Map', { var layer; var mapLayer = user.get('map') || server.get('map'); - var bindKey = 'AseEs0DLJhLlTNoxbNXu7DGsnnH4UoWuGue7-irwKkE3fffaClwc9q_Mr6AyHY8F'; + var bingKey = server.get('bingKey'); - if (mapLayer === 'bingRoad') { + if (mapLayer === 'custom') { + layer = new ol.layer.Tile({ source: new ol.source.XYZ({ + url: server.get('mapUrl') + })}); + } else if (mapLayer === 'bingRoad') { layer = new ol.layer.Tile({ source: new ol.source.BingMaps({ - key: bindKey, + key: bingKey, imagerySet: 'Road' })}); } else if (mapLayer === 'bingAerial') { layer = new ol.layer.Tile({ source: new ol.source.BingMaps({ - key: bindKey, + key: bingKey, imagerySet: 'Aerial' })}); } else { diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js index 98922a307..0aab71725 100644 --- a/web/app/view/map/MapController.js +++ b/web/app/view/map/MapController.js @@ -128,9 +128,8 @@ Ext.define('Traccar.view.map.MapController', { var vectorSource = this.getView().vectorSource; - var data = Ext.getStore('Positions').getData().clone(); - data.sort('fixTime'); - + var data = Ext.getStore('Positions').getData(); + var index; var positions = []; this.reportRoutePoints = {}; diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js index 58bc5c55c..73dc28b50 100644 --- a/web/app/view/state/StateController.js +++ b/web/app/view/state/StateController.js @@ -73,6 +73,14 @@ Ext.define('Traccar.view.state.StateController', { } }, + formatValue: function(value) { + if (typeof(id) === 'number') { + return +value.toFixed(2); + } else { + return value; + } + }, + updatePosition: function(position) { var other; @@ -93,7 +101,7 @@ Ext.define('Traccar.view.state.StateController', { store.add(Ext.create('Traccar.model.Parameter', { priority: this.keys[key].priority, name: this.keys[key].name, - value: value + value: this.formatValue(value) })); } } @@ -119,7 +127,7 @@ Ext.define('Traccar.view.state.StateController', { name: key.replace(/^./, function (match) { return match.toUpperCase(); }), - value: value + value: this.formatValue(value) })); } } |