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:
Andreas Hocevar
2015-11-13 12:13:38 +01:00
parent f5a148e6b3
commit 6280b35035
6 changed files with 78 additions and 23 deletions

View File

@@ -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.
*