From 3d05dfd49802696882bc77165e48b3b4db6d1603 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 9 Nov 2015 16:54:10 +1300 Subject: Set rotation in radians and keep it --- web/app/view/MapController.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'web') diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index 9ccc3d57c..7abce1ff5 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -76,7 +76,7 @@ Ext.define('Traccar.view.MapController', { this.getView().getVectorSource().addFeature(marker); style = this.getLatestMarker(); - style.getImage().setRotation(position.get('course')); + style.getImage().setRotation(position.get('course') * 180 / Math.PI); style.getText().setText(device.get('name')); marker.setStyle(style); } @@ -109,7 +109,7 @@ Ext.define('Traccar.view.MapController', { this.getView().getVectorSource().addFeature(marker); style = this.getReportMarker(); - style.getImage().setRotation(position.get('course')); + style.getImage().setRotation(position.get('course') * 180 / Math.PI); // style.getText().setText('2000-01-01 00:00:00'); // TODO show time marker.setStyle(style); @@ -187,7 +187,8 @@ Ext.define('Traccar.view.MapController', { image: new ol.style.Arrow({ radius: radius, fill: style.getImage().getFill(), - stroke: style.getImage().getStroke() + stroke: style.getImage().getStroke(), + rotation: style.getImage().getRotation() }), text: style.getText() }); -- cgit v1.2.3