Add pixelRatio to ol.source.Image#createImage
This commit is contained in:
@@ -78,12 +78,13 @@ goog.inherits(ol.source.Image, ol.source.Source);
|
|||||||
* @protected
|
* @protected
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {ol.Size} size Size.
|
* @param {ol.Size} size Size.
|
||||||
* @param {ol.proj.Projection} projection Projection.
|
* @param {ol.proj.Projection} projection Projection.
|
||||||
* @return {ol.Image} Single image.
|
* @return {ol.Image} Single image.
|
||||||
*/
|
*/
|
||||||
ol.source.Image.prototype.createImage =
|
ol.source.Image.prototype.createImage =
|
||||||
function(extent, resolution, size, projection) {
|
function(extent, resolution, pixelRatio, size, projection) {
|
||||||
var image = null;
|
var image = null;
|
||||||
var imageUrl = this.imageUrlFunction(extent, size, projection);
|
var imageUrl = this.imageUrlFunction(extent, size, projection);
|
||||||
if (goog.isDef(imageUrl)) {
|
if (goog.isDef(imageUrl)) {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ ol.source.ImageStatic = function(options) {
|
|||||||
* @type {ol.Image}
|
* @type {ol.Image}
|
||||||
*/
|
*/
|
||||||
this.image_ = this.createImage(
|
this.image_ = this.createImage(
|
||||||
imageExtent, imageResolution, imageSize, projection);
|
imageExtent, imageResolution, 1, imageSize, projection);
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.source.ImageStatic, ol.source.Image);
|
goog.inherits(ol.source.ImageStatic, ol.source.Image);
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ ol.source.ImageWMS.prototype.getImage =
|
|||||||
var height = (extent[3] - extent[1]) / resolution;
|
var height = (extent[3] - extent[1]) / resolution;
|
||||||
var size = [width, height];
|
var size = [width, height];
|
||||||
|
|
||||||
this.image_ = this.createImage(extent, resolution, size, projection);
|
this.image_ = this.createImage(
|
||||||
|
extent, resolution, pixelRatio, size, projection);
|
||||||
return this.image_;
|
return this.image_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ ol.source.MapGuide.prototype.getImage =
|
|||||||
var height = (extent[3] - extent[1]) / resolution;
|
var height = (extent[3] - extent[1]) / resolution;
|
||||||
var size = [width, height];
|
var size = [width, height];
|
||||||
|
|
||||||
this.image_ = this.createImage(extent, resolution, size, projection);
|
this.image_ = this.createImage(
|
||||||
|
extent, resolution, pixelRatio, size, projection);
|
||||||
return this.image_;
|
return this.image_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user