aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-20 13:59:41 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-20 13:59:41 +0500
commitf5c48588e2709e87e60703591e674ed9c5037077 (patch)
treeecb7ee23b9b5b8997fcf8bc5b5959fdeaa40836d /web/app/view
parent86e790c93f68016bcbf691adca8a0edfebb5fa38 (diff)
downloadetbsa-traccar-web-f5c48588e2709e87e60703591e674ed9c5037077.tar.gz
etbsa-traccar-web-f5c48588e2709e87e60703591e674ed9c5037077.tar.bz2
etbsa-traccar-web-f5c48588e2709e87e60703591e674ed9c5037077.zip
Remove marker on device removing
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/MapController.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js
index ba72171..9fcd493 100644
--- a/web/app/view/MapController.js
+++ b/web/app/view/MapController.js
@@ -38,7 +38,8 @@ Ext.define('Traccar.view.MapController', {
store: {
'#Devices': {
add: 'updateDevice',
- update: 'updateDevice'
+ update: 'updateDevice',
+ remove: 'removeDevice'
},
'#LatestPositions': {
add: 'updateLatest',
@@ -114,6 +115,19 @@ Ext.define('Traccar.view.MapController', {
}
},
+ removeDevice: function (store, data) {
+ var i, deviceId;
+ if (!Ext.isArray(data)) {
+ data = [data];
+ }
+ for (i = 0; i < data.length; i++) {
+ deviceId = data[i].get('id');
+ if (this.latestMarkers[deviceId]) {
+ this.getView().getLatestSource().removeFeature(this.latestMarkers[deviceId]);
+ }
+ }
+ },
+
onFollowClick: function (button, pressed) {
if (pressed && this.selectedMarker) {
this.getView().getMapView().setCenter(this.selectedMarker.getGeometry().getCoordinates());