aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/map/BaseMap.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-30 16:18:34 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-30 16:18:34 +0500
commit4f077390348cb9d28fc27759c69b921a4177a9ee (patch)
tree631555888e8a5814e7511eec350542aae539f43d /web/app/view/map/BaseMap.js
parentc321abccb465b4ee66c5de087be7bb9223c4d301 (diff)
downloadtrackermap-web-4f077390348cb9d28fc27759c69b921a4177a9ee.tar.gz
trackermap-web-4f077390348cb9d28fc27759c69b921a4177a9ee.tar.bz2
trackermap-web-4f077390348cb9d28fc27759c69b921a4177a9ee.zip
Add scale line to map
Diffstat (limited to 'web/app/view/map/BaseMap.js')
-rw-r--r--web/app/view/map/BaseMap.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js
index a0d346ec..ea7b58d7 100644
--- a/web/app/view/map/BaseMap.js
+++ b/web/app/view/map/BaseMap.js
@@ -175,6 +175,21 @@ 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());
+ }
+
target = this.map.getTarget();
if (typeof target === 'string') {
target = Ext.get(target).dom;