Add imageLoadFunction option for ol.source.ImageStatic

This commit is contained in:
Andreas Hocevar
2014-10-29 20:09:47 +01:00
parent 46870456ac
commit a1e19b4905
2 changed files with 5 additions and 1 deletions

View File

@@ -4535,6 +4535,7 @@ olx.source.StamenOptions.prototype.url;
* crossOrigin: (null|string|undefined),
* imageExtent: (ol.Extent),
* imageSize: (ol.Size|undefined),
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
* logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike,
* url: string}}

View File

@@ -34,6 +34,9 @@ ol.source.ImageStatic = function(options) {
var crossOrigin = goog.isDef(options.crossOrigin) ?
options.crossOrigin : null;
var imageLoadFunction = goog.isDef(options.imageLoadFunction) ?
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
goog.base(this, {
attributions: attributions,
logo: options.logo,
@@ -46,7 +49,7 @@ ol.source.ImageStatic = function(options) {
* @type {ol.Image}
*/
this.image_ = new ol.Image(imageExtent, resolution, 1, attributions,
options.url, crossOrigin);
options.url, crossOrigin, imageLoadFunction);
};
goog.inherits(ol.source.ImageStatic, ol.source.Image);