Use the image pixelRatio in ol.renderer.canvas.ImageLayer

This commit is contained in:
Frederic Junod
2013-12-16 17:07:37 +01:00
parent db322f9ade
commit c84782bfc6
3 changed files with 3 additions and 3 deletions

View File

@@ -95,7 +95,7 @@ ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
if (!goog.isNull(this.image_)) {
image = this.image_;
var imageExtent = image.getExtent();
var imageResolution = image.getResolution();
var imageResolution = image.getResolution() / image.getPixelRatio();
var devicePixelRatio = frameState.devicePixelRatio;
ol.vec.Mat4.makeTransform2D(this.imageTransform_,
devicePixelRatio * frameState.size[0] / 2,

View File

@@ -84,7 +84,7 @@ ol.source.ImageWMS.prototype.getImage =
ol.extent.scaleFromCenter(extent, this.ratio_);
var width = (extent[2] - extent[0]) / resolution;
var height = (extent[3] - extent[1]) / resolution;
var size = [width, height];
var size = [width * pixelRatio, height * pixelRatio];
this.image_ = this.createImage(
extent, resolution, pixelRatio, size, projection);

View File

@@ -89,7 +89,7 @@ ol.source.MapGuide.prototype.getImage =
}
var width = (extent[2] - extent[0]) / resolution;
var height = (extent[3] - extent[1]) / resolution;
var size = [width, height];
var size = [width * pixelRatio, height * pixelRatio];
this.image_ = this.createImage(
extent, resolution, pixelRatio, size, projection);