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.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js
index ba72171d..9fcd4939 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());