Add layer also for programmatically selected features

This commit is contained in:
Andreas Hocevar
2021-12-21 08:23:56 +01:00
parent e5a32f533e
commit 4f7cadd17d
4 changed files with 62 additions and 6 deletions

View File

@@ -375,6 +375,13 @@ describe('ol.interaction.Select', function () {
// Select again to make sure the style change does not break selection
simulateEvent('singleclick', 10, -20);
});
it('returns a layer from a programmatically selected feature', function () {
const feature = source.getFeatures()[0];
interaction.getFeatures().push(feature);
const layerWithSelectedFeature = interaction.getLayer(feature);
expect(layerWithSelectedFeature).to.equal(layer);
});
});
describe('#setActive()', function () {