From 772c093353e6d5e1d41b0bc3e6a0501a400c7202 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 14 Nov 2015 11:41:41 +1300 Subject: Fix rotation calculation bug --- web/app/view/MapController.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/app/view') diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index bc8ca843c..2f4eb5a3c 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -76,10 +76,11 @@ Ext.define('Traccar.view.MapController', { this.getView().getVectorSource().addFeature(marker); style = this.getLatestMarker(); - style.getImage().setRotation(position.get('course') * 180 / Math.PI); style.getText().setText(device.get('name')); marker.setStyle(style); } + + marker.getStyle().getImage().setRotation(position.get('course') * Math.PI / 180); } }, @@ -109,7 +110,7 @@ Ext.define('Traccar.view.MapController', { this.getView().getVectorSource().addFeature(marker); style = this.getReportMarker(); - style.getImage().setRotation(position.get('course') * 180 / Math.PI); + style.getImage().setRotation(position.get('course') * Math.PI / 180 ); style.getText().setText( Ext.Date.format(position.get('fixTime'), Traccar.Style.dateTimeFormat)); -- cgit v1.2.3