Add getUrl and getImageExtent to ImageStatic API
This commit is contained in:
@@ -38,8 +38,6 @@ class Static extends ImageSource {
|
|||||||
* @param {module:ol/source/ImageStatic~Options=} options ImageStatic options.
|
* @param {module:ol/source/ImageStatic~Options=} options ImageStatic options.
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
const imageExtent = options.imageExtent;
|
|
||||||
|
|
||||||
const crossOrigin = options.crossOrigin !== undefined ?
|
const crossOrigin = options.crossOrigin !== undefined ?
|
||||||
options.crossOrigin : null;
|
options.crossOrigin : null;
|
||||||
|
|
||||||
@@ -52,11 +50,23 @@ class Static extends ImageSource {
|
|||||||
projection: getProjection(options.projection)
|
projection: getProjection(options.projection)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.url_ = options.url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {module:ol/extent~Extent}
|
||||||
|
*/
|
||||||
|
this.imageExtent_ = options.imageExtent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/Image}
|
* @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
|
* @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
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
@@ -79,6 +98,15 @@ class Static extends ImageSource {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the URL used for this image source.
|
||||||
|
* @return {string} URL.
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
getUrl() {
|
||||||
|
return this.url_;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user