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

@@ -8,6 +8,7 @@ goog.require('goog.string');
goog.require('goog.uri.utils');
goog.require('ol');
goog.require('ol.Image');
goog.require('ol.ImageLoadFunctionType');
goog.require('ol.extent');
goog.require('ol.proj');
goog.require('ol.source.Image');
@@ -49,6 +50,13 @@ ol.source.ImageWMS = function(opt_options) {
*/
this.url_ = options.url;
/**
* @private
* @type {ol.ImageLoadFunctionType}
*/
this.imageLoadFunction_ = goog.isDef(options.imageLoadFunction) ?
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
/**
* @private
* @type {Object}
@@ -235,7 +243,7 @@ ol.source.ImageWMS.prototype.getImage =
projection, params);
this.image_ = new ol.Image(extent, resolution, pixelRatio,
this.getAttributions(), url, this.crossOrigin_);
this.getAttributions(), url, this.crossOrigin_, this.imageLoadFunction_);
this.renderedRevision_ = this.getRevision();