diff options
Diffstat (limited to 'web/app/view/BaseMap.js')
-rw-r--r-- | web/app/view/BaseMap.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/web/app/view/BaseMap.js b/web/app/view/BaseMap.js index f0d51d52..f329cf28 100644 --- a/web/app/view/BaseMap.js +++ b/web/app/view/BaseMap.js @@ -120,9 +120,17 @@ Ext.define('Traccar.view.BaseMap', { }); this.map.on('click', function (e) { - this.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) { - this.fireEvent('selectfeature', feature); - }.bind(this)); + if (this.map.hasFeatureAtPixel(e.pixel, { + layerFilter: function (layer) { + return layer.get('name') !== 'geofencesLayer'; + } + })) { + this.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) { + this.fireEvent('selectfeature', feature); + }.bind(this)); + } else { + this.fireEvent('deselectfeature'); + } }, this); }, |