Use the image pixelRatio in ol.renderer.canvas.ImageLayer
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user