diff options
Diffstat (limited to 'web')
-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); |