Add imageLoadFunction option for ol.source.ImageWMS

This commit is contained in:
Andreas Hocevar
2014-10-29 20:10:00 +01:00
parent a1e19b4905
commit fed6376e26
3 changed files with 20 additions and 1 deletions

View File

@@ -134,6 +134,16 @@ describe('ol.source.ImageWMS', function() {
expect(queryData.get('DPI')).to.be('180');
});
it('creates an image with a custom imageLoadFunction', function() {
var imageLoadFunction = sinon.spy();
options.imageLoadFunction = imageLoadFunction;
var source = new ol.source.ImageWMS(options);
var image = source.getImage(extent, resolution, pixelRatio, projection);
image.load();
expect(imageLoadFunction).to.be.called();
expect(imageLoadFunction.calledWith(image, image.src_)).to.be(true);
});
});
describe('#getGetFeatureInfo', function() {