aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-30 23:25:24 +1200
committerGitHub <noreply@github.com>2017-08-30 23:25:24 +1200
commit4a0c50311ac352ddf3f80e64a25ea32f45f1d138 (patch)
tree84d16fb6a721676a6440bbda60c523a4ea0d208a
parent7293ff66d0e1e5191d58d6d4aebea9acf80f9a44 (diff)
parent3ad848939c559c10f1d77de8f75c19c588f4f22d (diff)
downloadetbsa-traccar-web-4a0c50311ac352ddf3f80e64a25ea32f45f1d138.tar.gz
etbsa-traccar-web-4a0c50311ac352ddf3f80e64a25ea32f45f1d138.tar.bz2
etbsa-traccar-web-4a0c50311ac352ddf3f80e64a25ea32f45f1d138.zip
Merge pull request #569 from Abyss777/scale_line
Add scale line to map
-rw-r--r--web/app/view/map/BaseMap.js16
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;