Support different resolutions in x and y direction for ol.source.ImageStatic

This commit is contained in:
Bart van den Eijnden
2015-10-30 15:01:01 +01:00
parent 7f4c6e3634
commit 979342091a
13 changed files with 75 additions and 31 deletions
@@ -193,15 +193,19 @@ ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
var imageExtent = image.getExtent();
var imageResolution = image.getResolution();
var imagePixelRatio = image.getPixelRatio();
var scale = pixelRatio * imageResolution /
var xImageResolution = imageResolution[0];
var yImageResolution = imageResolution[1];
var xScale = pixelRatio * xImageResolution /
(viewResolution * imagePixelRatio);
var yScale = pixelRatio * yImageResolution /
(viewResolution * imagePixelRatio);
ol.vec.Mat4.makeTransform2D(this.imageTransform_,
pixelRatio * frameState.size[0] / 2,
pixelRatio * frameState.size[1] / 2,
scale, scale,
xScale, yScale,
viewRotation,
imagePixelRatio * (imageExtent[0] - viewCenter[0]) / imageResolution,
imagePixelRatio * (viewCenter[1] - imageExtent[3]) / imageResolution);
imagePixelRatio * (imageExtent[0] - viewCenter[0]) / xImageResolution,
imagePixelRatio * (viewCenter[1] - imageExtent[3]) / yImageResolution);
this.imageTransformInv_ = null;
this.updateAttributions(frameState.attributions, image.getAttributions());
this.updateLogos(frameState, imageSource);