aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/MapController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/MapController.js')
-rw-r--r--web/app/view/MapController.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js
index c52fdd5f..b8e2657d 100644
--- a/web/app/view/MapController.js
+++ b/web/app/view/MapController.js
@@ -27,7 +27,8 @@ Ext.define('Traccar.view.MapController', {
listen: {
controller: {
'*': {
- mapstaterequest: 'getMapState'
+ mapstaterequest: 'getMapState',
+ togglestaterequest: 'getToggleState'
}
},
store: {
@@ -44,6 +45,14 @@ Ext.define('Traccar.view.MapController', {
init: function () {
this.callParent();
this.lookupReference('showReportsButton').setVisible(Traccar.app.isMobile());
+ this.lookupReference('deviceFollowButton').setPressed(
+ Traccar.app.getAttributePreference('web.followToggle', 'false') === 'true');
+ this.lookupReference('showGeofencesButton').setPressed(
+ Traccar.app.getAttributePreference('web.geofenceToggle', 'true') === 'true');
+ this.lookupReference('showLiveRoutes').setPressed(
+ Traccar.app.getAttributePreference('web.liveRouteToggle', 'false') === 'true');
+ Ext.getCmp('muteButton').setPressed(
+ Traccar.app.getAttributePreference('web.muteToggle', 'true') === 'true');
},
showReports: function () {
@@ -68,6 +77,15 @@ Ext.define('Traccar.view.MapController', {
this.fireEvent('mapstate', center[1], center[0], zoom);
},
+ getToggleState: function () {
+ var state = {};
+ state['web.followToggle'] = this.lookupReference('deviceFollowButton').pressed.toString();
+ state['web.geofenceToggle'] = this.lookupReference('showGeofencesButton').pressed.toString();
+ state['web.liveRouteToggle'] = this.lookupReference('showLiveRoutes').pressed.toString();
+ state['web.muteToggle'] = Ext.getCmp('muteButton').pressed.toString();
+ this.fireEvent('togglestate', state);
+ },
+
getGeofenceStyle: function (label) {
return new ol.style.Style({
fill: new ol.style.Fill({