diff --git a/src/ol/source/ImageStatic.js b/src/ol/source/ImageStatic.js index f81e8b38f4..a9e99a7eeb 100644 --- a/src/ol/source/ImageStatic.js +++ b/src/ol/source/ImageStatic.js @@ -38,8 +38,6 @@ class Static extends ImageSource { * @param {module:ol/source/ImageStatic~Options=} options ImageStatic options. */ constructor(options) { - const imageExtent = options.imageExtent; - const crossOrigin = options.crossOrigin !== undefined ? options.crossOrigin : null; @@ -52,11 +50,23 @@ class Static extends ImageSource { projection: getProjection(options.projection) }); + /** + * @private + * @type {string} + */ + this.url_ = options.url; + + /** + * @private + * @type {module:ol/extent~Extent} + */ + this.imageExtent_ = options.imageExtent; + /** * @private * @type {module:ol/Image} */ - this.image_ = new ImageWrapper(imageExtent, undefined, 1, options.url, crossOrigin, imageLoadFunction); + this.image_ = new ImageWrapper(this.imageExtent_, undefined, 1, options.url, crossOrigin, imageLoadFunction); /** * @private @@ -69,6 +79,15 @@ class Static extends ImageSource { } + /** + * Returns the image extent + * @return {module:ol/extent~Extent} image extent. + * @api + */ + getImageExtent() { + return this.imageExtent_; + } + /** * @inheritDoc */ @@ -79,6 +98,15 @@ class Static extends ImageSource { return null; } + /** + * Return the URL used for this image source. + * @return {string} URL. + * @api + */ + getUrl() { + return this.url_; + } + /** * @inheritDoc */