- Update device icon on map after device update

- Fix devices buttons enabling
This commit is contained in:
Abyss777 2016-11-10 13:20:51 +05:00
parent 185a6e4b35
commit fb76f0118e
2 changed files with 4 additions and 3 deletions

View File

@ -147,6 +147,7 @@ Ext.define('Traccar.view.DevicesController', {
selectDevice: function (device, center) {
this.getView().getSelectionModel().select([device], false, true);
this.updateButtons(this.getView().getSelectionModel());
this.getView().getView().focusRow(device);
},

View File

@ -86,12 +86,12 @@ Ext.define('Traccar.view.MapController', {
}
},
changeMarkerColor: function (style, color) {
changeMarkerColor: function (style, color, category) {
var newStyle = new ol.style.Style({
image: Traccar.DeviceImages.getImageIcon(color,
style.getImage().zoom,
style.getImage().angle,
style.getImage().category),
category),
text: style.getText()
});
return newStyle;
@ -111,7 +111,7 @@ Ext.define('Traccar.view.MapController', {
if (deviceId in this.latestMarkers) {
marker = this.latestMarkers[deviceId];
marker.setStyle(
this.changeMarkerColor(marker.getStyle(), this.getDeviceColor(device)));
this.changeMarkerColor(marker.getStyle(), this.getDeviceColor(device), device.get('category')));
}
}
},