Add pixelRatio param to ol.Image constructor

This commit is contained in:
Frederic Junod
2013-12-16 12:48:58 +01:00
parent 78ec21fb85
commit db322f9ade
4 changed files with 20 additions and 2 deletions

View File

@@ -28,11 +28,13 @@ ol.ImageState = {
* @extends {goog.events.EventTarget}
* @param {ol.Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin.
* @param {Array.<ol.Attribution>} attributions Attributions.
*/
ol.Image = function(extent, resolution, src, crossOrigin, attributions) {
ol.Image =
function(extent, resolution, pixelRatio, src, crossOrigin, attributions) {
goog.base(this);
@@ -54,6 +56,12 @@ ol.Image = function(extent, resolution, src, crossOrigin, attributions) {
*/
this.src_ = src;
/**
* @private
* @type {number}
*/
this.pixelRatio_ = pixelRatio;
/**
* @private
* @type {number}
@@ -137,6 +145,14 @@ ol.Image.prototype.getImageElement = function(opt_context) {
};
/**
* @return {number} PixelRatio.
*/
ol.Image.prototype.getPixelRatio = function() {
return this.pixelRatio_;
};
/**
* @return {number} Resolution.
*/