From 34c878d014a065981d56859cb73564bfa2bc478e Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 13 Jan 2017 09:26:24 +0500 Subject: Initial manager implementation --- web/app/view/MapController.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'web/app/view/MapController.js') diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index 66d6809..a9edee9 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ Ext.define('Traccar.view.MapController', { }, store: { '#Geofences': { - load: 'showGeofences', + load: 'updateGeofences', add: 'updateGeofences', update: 'updateGeofences', remove: 'updateGeofences' @@ -118,7 +118,8 @@ Ext.define('Traccar.view.MapController', { }); }, - showGeofences: function () { + updateGeofences: function () { + this.getView().getGeofencesSource().clear(); if (this.lookupReference('showGeofencesButton').pressed) { Ext.getStore('Geofences').each(function (geofence) { var feature = new ol.Feature(Traccar.GeofenceConverter @@ -128,15 +129,6 @@ Ext.define('Traccar.view.MapController', { this.getView().getGeofencesSource().addFeature(feature); return true; }, this); - } else { - this.getView().getGeofencesSource().clear(); - } - }, - - updateGeofences: function () { - if (this.lookupReference('showGeofencesButton').pressed) { - this.getView().getGeofencesSource().clear(); - this.showGeofences(); } } }); -- cgit v1.2.3