diff options
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/map/BaseMap.js | 10 | ||||
-rw-r--r-- | web/app/view/map/GeofenceMap.js | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index f973fb8..4f0c8d4 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -30,7 +30,7 @@ Ext.define('Traccar.view.map.BaseMap', { }, initMap: function () { - var server, layer, type, bingKey, lat, lon, zoom, maxZoom, target, poiLayer; + var server, layer, type, bingKey, lat, lon, zoom, maxZoom, target, poiLayer, self = this; server = Traccar.app.getServer(); @@ -207,19 +207,19 @@ Ext.define('Traccar.view.map.BaseMap', { }); this.map.on('click', function (e) { - var i, features = this.map.getFeaturesAtPixel(e.pixel, { + var i, features = self.map.getFeaturesAtPixel(e.pixel, { layerFilter: function (layer) { return !layer.get('name'); } }); if (features) { for (i = 0; i < features.length; i++) { - this.fireEvent('selectfeature', features[i]); + self.fireEvent('selectfeature', features[i]); } } else { - this.fireEvent('deselectfeature'); + self.fireEvent('deselectfeature'); } - }, this); + }); }, listeners: { diff --git a/web/app/view/map/GeofenceMap.js b/web/app/view/map/GeofenceMap.js index 6b06ae9..8cef574 100644 --- a/web/app/view/map/GeofenceMap.js +++ b/web/app/view/map/GeofenceMap.js @@ -105,13 +105,14 @@ Ext.define('Traccar.view.map.GeofenceMap', { }, addInteraction: function (type) { + var self = this; this.draw = new ol.interaction.Draw({ features: this.features, type: type }); this.draw.on('drawstart', function () { - this.features.clear(); - }, this); + self.features.clear(); + }); this.map.addInteraction(this.draw); }, |