diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-09-18 22:15:32 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-09-18 22:15:32 -0700 |
commit | b69eb1d72ce706d4e76014daa19b3720ee633feb (patch) | |
tree | c56a3daf365199aecf824289aadd3d566c71c530 /web/app | |
parent | edb24a1bd6649e672bf142b9b873b47dec31f0e3 (diff) | |
download | trackermap-web-b69eb1d72ce706d4e76014daa19b3720ee633feb.tar.gz trackermap-web-b69eb1d72ce706d4e76014daa19b3720ee633feb.tar.bz2 trackermap-web-b69eb1d72ce706d4e76014daa19b3720ee633feb.zip |
Add accuracy button
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/view/map/Map.js | 16 | ||||
-rw-r--r-- | web/app/view/map/MapController.js | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/web/app/view/map/Map.js b/web/app/view/map/Map.js index fbaa7587..36e81de7 100644 --- a/web/app/view/map/Map.js +++ b/web/app/view/map/Map.js @@ -66,6 +66,13 @@ Ext.define('Traccar.view.map.Map', { stateId: 'show-geofences-button', tooltip: Strings.sharedGeofences }, { + handler: 'showAccuracy', + reference: 'showAccuracyButton', + glyph: 'xf140@FontAwesome', + pressed: true, + stateId: 'show-accuracy-button', + tooltip: Strings.positionAccuracy + }, { handler: 'showCurrentLocation', glyph: 'xf124@FontAwesome', tooltip: Strings.mapCurrentLocation @@ -95,6 +102,10 @@ Ext.define('Traccar.view.map.Map', { return this.accuracySource; }, + getAccuracyLayer: function () { + return this.accuracyLayer; + }, + getRouteSource: function () { return this.routeSource; }, @@ -133,10 +144,11 @@ Ext.define('Traccar.view.map.Map', { })); this.accuracySource = new ol.source.Vector({}); - this.map.addLayer(new ol.layer.Vector({ + this.accuracyLayer = new ol.layer.Vector({ name: 'accuracyLayer', source: this.accuracySource - })); + }); + this.map.addLayer(this.accuracyLayer); this.markersSource = new ol.source.Vector({}); this.map.addLayer(new ol.layer.Vector({ diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js index 7ba0ee3b..d025b586 100644 --- a/web/app/view/map/MapController.js +++ b/web/app/view/map/MapController.js @@ -68,6 +68,10 @@ Ext.define('Traccar.view.map.MapController', { this.getView().getLiveRouteLayer().setVisible(button.pressed); }, + showAccuracy: function (button) { + this.getView().getAccuracyLayer().setVisible(button.pressed); + }, + getMapState: function () { var zoom, center, projection; projection = this.getView().getMapView().getProjection(); |