diff options
Diffstat (limited to 'web/app/view/BaseMap.js')
-rw-r--r-- | web/app/view/BaseMap.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/web/app/view/BaseMap.js b/web/app/view/BaseMap.js index f0d51d52..d7309e76 100644 --- a/web/app/view/BaseMap.js +++ b/web/app/view/BaseMap.js @@ -120,9 +120,16 @@ 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); }, |