aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
Diffstat (limited to 'web/app')
-rw-r--r--web/app/view/map/BaseMap.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js
index 5829cac9..91f37841 100644
--- a/web/app/view/map/BaseMap.js
+++ b/web/app/view/map/BaseMap.js
@@ -182,14 +182,15 @@ Ext.define('Traccar.view.map.BaseMap', {
});
this.map.on('click', function (e) {
- if (this.map.hasFeatureAtPixel(e.pixel, {
+ var i, features = this.map.getFeaturesAtPixel(e.pixel, {
layerFilter: function (layer) {
return !layer.get('name');
}
- })) {
- this.map.forEachFeatureAtPixel(e.pixel, function (feature) {
- this.fireEvent('selectfeature', feature);
- }.bind(this));
+ });
+ if (features) {
+ for (i = 0; i < features.length; i++) {
+ this.fireEvent('selectfeature', features[i]);
+ }
} else {
this.fireEvent('deselectfeature');
}