From ce8d57b53412179e9765c47dc055d2bb594a81bf Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Thu, 5 Feb 2015 10:45:22 +0100 Subject: [PATCH] Add setters and getters for imageLoadFunction --- src/ol/source/imagemapguidesource.js | 21 +++++++++++++++++++++ src/ol/source/imagewmssource.js | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/ol/source/imagemapguidesource.js b/src/ol/source/imagemapguidesource.js index 3d7c18f11f..de728275eb 100644 --- a/src/ol/source/imagemapguidesource.js +++ b/src/ol/source/imagemapguidesource.js @@ -160,6 +160,15 @@ ol.source.ImageMapGuide.prototype.getImage = }; +/** + * @return {ol.ImageLoadFunctionType} The image load function. + * @api + */ +ol.source.ImageMapGuide.prototype.getImageLoadFunction = function() { + return this.imageLoadFunction_; +}; + + /** * @param {ol.Extent} extent The map extents. * @param {ol.Size} size the viewport size. @@ -221,3 +230,15 @@ ol.source.ImageMapGuide.prototype.getUrl = goog.object.extend(baseParams, params); return goog.uri.utils.appendParamsFromMap(baseUrl, baseParams); }; + + +/** + * @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function. + * @api + */ +ol.source.ImageMapGuide.prototype.setImageLoadFunction = function( + imageLoadFunction) { + this.image_ = null; + this.imageLoadFunction_ = imageLoadFunction; + this.changed(); +}; diff --git a/src/ol/source/imagewmssource.js b/src/ol/source/imagewmssource.js index c42e1cdddd..b058b82557 100644 --- a/src/ol/source/imagewmssource.js +++ b/src/ol/source/imagewmssource.js @@ -252,6 +252,15 @@ ol.source.ImageWMS.prototype.getImage = }; +/** + * @return {ol.ImageLoadFunctionType} The image load function. + * @api + */ +ol.source.ImageWMS.prototype.getImageLoadFunction = function() { + return this.imageLoadFunction_; +}; + + /** * @param {ol.Extent} extent Extent. * @param {ol.Size} size Size. @@ -319,6 +328,18 @@ ol.source.ImageWMS.prototype.getUrl = function() { }; +/** + * @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function. + * @api + */ +ol.source.ImageWMS.prototype.setImageLoadFunction = function( + imageLoadFunction) { + this.image_ = null; + this.imageLoadFunction_ = imageLoadFunction; + this.changed(); +}; + + /** * @param {string|undefined} url URL. * @api stable