Make new behavior overridable; update docs and examples

This commit is contained in:
ahocevar
2018-10-14 12:10:40 +02:00
parent af4e5ca7cf
commit 2768884044
30 changed files with 43 additions and 167 deletions

View File

@@ -95,4 +95,23 @@ describe('ol.control.Attribution', function() {
expect(attribution.length).to.be(1);
});
it('renders attributions as collapsible if configured with collapsible set to true', function() {
map.getControls().clear();
map.addControl(new Attribution({collapsible: true}));
const source = new TileSource({
projection: 'EPSG:3857',
tileGrid: createXYZ(),
attributions: 'foo',
attributionsCollapsible: false
});
source.getTile = tileLoadFunction;
map.addLayer(new TileLayer({
source: source
}));
map.renderSync();
const attribution = map.getTarget().querySelectorAll('.ol-attribution.ol-uncollapsible');
expect(attribution.length).to.be(0);
});
});