aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/MapController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-14 11:41:41 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-14 11:41:41 +1300
commit772c093353e6d5e1d41b0bc3e6a0501a400c7202 (patch)
tree171bc1fac665406d917ff4091f5d8139697d66ee /web/app/view/MapController.js
parenteb40246064d5185edf1d620dcf7270ffe9d7c074 (diff)
downloadtrackermap-server-772c093353e6d5e1d41b0bc3e6a0501a400c7202.tar.gz
trackermap-server-772c093353e6d5e1d41b0bc3e6a0501a400c7202.tar.bz2
trackermap-server-772c093353e6d5e1d41b0bc3e6a0501a400c7202.zip
Fix rotation calculation bug
Diffstat (limited to 'web/app/view/MapController.js')
-rw-r--r--web/app/view/MapController.js5
1 files changed, 3 insertions, 2 deletions
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));