diff options
author | Abyss777 <abyss@fox5.ru> | 2016-12-29 16:31:11 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-12-29 16:31:11 +0500 |
commit | d9be85d9928a9c511335a3a2eb231dcfd1fb1d5a (patch) | |
tree | 990756691ce721cc865918b983c20a96ce4c5561 /web/app/view/BaseMap.js | |
parent | 3362bc6315a7711b40649ee3a07fbfc8b0ff4ef8 (diff) | |
download | etbsa-traccar-web-d9be85d9928a9c511335a3a2eb231dcfd1fb1d5a.tar.gz etbsa-traccar-web-d9be85d9928a9c511335a3a2eb231dcfd1fb1d5a.tar.bz2 etbsa-traccar-web-d9be85d9928a9c511335a3a2eb231dcfd1fb1d5a.zip |
Deselect markers
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 f0d51d5..d7309e7 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); }, |