diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-09 16:54:10 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-09 16:54:10 +1300 |
commit | 3d05dfd49802696882bc77165e48b3b4db6d1603 (patch) | |
tree | dbafb802e38b744a42633050ec8bc2ff4fd28545 | |
parent | d04c2e83b12b6a546493a60f13ebf63253953787 (diff) | |
download | trackermap-server-3d05dfd49802696882bc77165e48b3b4db6d1603.tar.gz trackermap-server-3d05dfd49802696882bc77165e48b3b4db6d1603.tar.bz2 trackermap-server-3d05dfd49802696882bc77165e48b3b4db6d1603.zip |
Set rotation in radians and keep it
-rw-r--r-- | web/app/view/MapController.js | 7 |
1 files changed, 4 insertions, 3 deletions
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() }); |