From 5a115dbbb249d4b38822cce053698fb12225663c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 31 Jan 2020 21:32:34 -0800 Subject: Fix accuracy radius (fix #765) --- web/app/view/map/MapMarkerController.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'web/app/view') 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); -- cgit v1.2.3