aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-01-31 21:32:34 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-01-31 21:32:34 -0800
commit5a115dbbb249d4b38822cce053698fb12225663c (patch)
tree0a28567463373bd407bcacae15cb4d67560bc27b /web/app
parentc6b57da224d30f48d394b4b0319ca9e30797186d (diff)
downloadtrackermap-web-5a115dbbb249d4b38822cce053698fb12225663c.tar.gz
trackermap-web-5a115dbbb249d4b38822cce053698fb12225663c.tar.bz2
trackermap-web-5a115dbbb249d4b38822cce053698fb12225663c.zip
Fix accuracy radius (fix #765)
Diffstat (limited to 'web/app')
-rw-r--r--web/app/view/map/MapMarkerController.js7
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);