diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-30 23:25:24 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-30 23:25:24 +1200 |
commit | 4a0c50311ac352ddf3f80e64a25ea32f45f1d138 (patch) | |
tree | 84d16fb6a721676a6440bbda60c523a4ea0d208a /web | |
parent | 7293ff66d0e1e5191d58d6d4aebea9acf80f9a44 (diff) | |
parent | 3ad848939c559c10f1d77de8f75c19c588f4f22d (diff) | |
download | trackermap-web-4a0c50311ac352ddf3f80e64a25ea32f45f1d138.tar.gz trackermap-web-4a0c50311ac352ddf3f80e64a25ea32f45f1d138.tar.bz2 trackermap-web-4a0c50311ac352ddf3f80e64a25ea32f45f1d138.zip |
Merge pull request #569 from Abyss777/scale_line
Add scale line to map
Diffstat (limited to 'web')
-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 a0d346ec..0559e0c9 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; |