From a2f24e445ef4c4c06a754b4538d51aec38e1dcbf Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 18 Aug 2017 13:53:13 +0500 Subject: Update openlayers to 4.3.1 --- web/app/view/map/BaseMap.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'web/app/view/map') diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index 5829cac..91f3784 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'); } -- cgit v1.2.3