Scale StaticImage image to imageExtent
The imageSize property was only used to determine the scale. It's usage was never documented nor tested nor shown in an example, so I removed it because I considered its presence a bug.
This commit is contained in:
@@ -35,7 +35,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Image}
|
||||
* @type {HTMLCanvasElement|Image|HTMLVideoElement}
|
||||
*/
|
||||
this.image_ = new Image();
|
||||
if (crossOrigin) {
|
||||
@@ -44,7 +44,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<number, Image>}
|
||||
* @type {Object.<number, (HTMLCanvasElement|Image|HTMLVideoElement)>}
|
||||
*/
|
||||
this.imageByContext_ = {};
|
||||
|
||||
@@ -142,6 +142,14 @@ ol.Image.prototype.load = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {HTMLCanvasElement|Image|HTMLVideoElement} image Image.
|
||||
*/
|
||||
ol.Image.prototype.setImage = function(image) {
|
||||
this.image_ = image;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Discards event handlers which listen for load completion or errors.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user