diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-01-31 21:32:34 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-01-31 21:32:34 -0800 |
commit | 5a115dbbb249d4b38822cce053698fb12225663c (patch) | |
tree | 0a28567463373bd407bcacae15cb4d67560bc27b | |
parent | c6b57da224d30f48d394b4b0319ca9e30797186d (diff) | |
download | trackermap-web-5a115dbbb249d4b38822cce053698fb12225663c.tar.gz trackermap-web-5a115dbbb249d4b38822cce053698fb12225663c.tar.bz2 trackermap-web-5a115dbbb249d4b38822cce053698fb12225663c.zip |
Fix accuracy radius (fix #765)
-rw-r--r-- | web/app/view/map/MapMarkerController.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js index 9c61fa61..64efdeef 100644 --- a/web/app/view/map/MapMarkerController.js +++ b/web/app/view/map/MapMarkerController.js @@ -243,15 +243,14 @@ Ext.define('Traccar.view.map.MapMarkerController', { }, updateAccuracy: function (position, device) { - var center, radius, feature, mapView, projection, pointResolution; + var center, radius, feature, mapView; mapView = this.getView().getMapView(); feature = this.accuracyCircles[position.get('deviceId')]; if (position.get('accuracy')) { - projection = mapView.getProjection(); center = ol.proj.fromLonLat([position.get('longitude'), position.get('latitude')]); - pointResolution = ol.proj.getPointResolution(projection, mapView.getResolution(), center); - radius = position.get('accuracy') / ol.proj.Units.METERS_PER_UNIT.m * mapView.getResolution() / pointResolution; + radius = Ext.getStore('DistanceUnits').convertValue( + position.get('accuracy'), Traccar.app.getAttributePreference('distanceUnit'), true); if (feature) { feature.getGeometry().setCenter(center); |