diff options
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/view/map/BaseMap.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index a0d346e..0559e0c 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -175,6 +175,22 @@ Ext.define('Traccar.view.map.BaseMap', { view: this.mapView }); + switch (Traccar.app.getPreference('distanceUnit', 'km')) { + case 'mi': + this.map.addControl(new ol.control.ScaleLine({ + units: 'us' + })); + break; + case 'nmi': + this.map.addControl(new ol.control.ScaleLine({ + units: 'nautical' + })); + break; + default: + this.map.addControl(new ol.control.ScaleLine()); + break; + } + target = this.map.getTarget(); if (typeof target === 'string') { target = Ext.get(target).dom; |