Fix select interaction regression caused by #4391
This commit is contained in:
@@ -283,7 +283,7 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
|
|||||||
* @param {ol.layer.Layer} layer Layer.
|
* @param {ol.layer.Layer} layer Layer.
|
||||||
*/
|
*/
|
||||||
function(feature, layer) {
|
function(feature, layer) {
|
||||||
if (layer && this.filter_(feature, layer)) {
|
if (!layer || this.filter_(feature, layer)) {
|
||||||
selected.push(feature);
|
selected.push(feature);
|
||||||
this.addFeatureLayerAssociation_(feature, layer);
|
this.addFeatureLayerAssociation_(feature, layer);
|
||||||
return !this.multi_;
|
return !this.multi_;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ describe('ol.interaction.Select', function() {
|
|||||||
unmanaged.setMap(map);
|
unmanaged.setMap(map);
|
||||||
map.renderSync();
|
map.renderSync();
|
||||||
simulateEvent(ol.MapBrowserEvent.EventType.SINGLECLICK, 10, -20);
|
simulateEvent(ol.MapBrowserEvent.EventType.SINGLECLICK, 10, -20);
|
||||||
expect(spy.firstCall.args[0]).to.not.equal(feature);
|
expect(spy.getCalls().length).to.be(0);
|
||||||
unmanaged.setMap(null);
|
unmanaged.setMap(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user