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

@@ -233,6 +233,19 @@ describe('ol/Map', function () {
});
});
describe('#getAllLayers()', function () {
it('returns all layers, also from inside groups', function () {
const map = new Map({});
const layer = new TileLayer();
const group = new LayerGroup({layers: [layer]});
map.addLayer(group);
const allLayers = map.getAllLayers();
expect(allLayers.length).to.be(1);
expect(allLayers[0]).to.be(layer);
});
});
describe('#setLayers()', function () {
it('adds an array of layers to the map', function () {
const map = new Map({});