make resolution in getGetLegendGraphicUrl optional

This commit is contained in:
simonseyock
2019-07-08 15:14:06 +02:00
parent f493f01bd0
commit c0000e745e
4 changed files with 40 additions and 19 deletions

View File

@@ -317,6 +317,14 @@ describe('ol.source.TileWMS', function() {
expect(queryData.get('SCALE')).to.be('357.14214285714274');
});
it('does not include SCALE if no resolution was provided', function() {
const source = new TileWMS(options);
const url = source.getGetLegendGraphicUrl();
const uri = new URL(url);
const queryData = uri.searchParams;
expect(queryData.get('SCALE')).to.be(null);
});
it('adds additional params as expected', function() {
const source = new TileWMS(options);
const url = source.getGetLegendGraphicUrl(0.1, {