Pass pixelRatio to canvasFunction
This commit is contained in:
@@ -2,7 +2,7 @@ goog.provide('ol.CanvasFunctionType');
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function(this:ol.source.ImageCanvas, ol.Extent, number, ol.Size,
|
||||
* ol.proj.Projection): HTMLCanvasElement}
|
||||
* @typedef {function(this:ol.source.ImageCanvas, ol.Extent, number,
|
||||
* number, ol.Size, ol.proj.Projection): HTMLCanvasElement}
|
||||
*/
|
||||
ol.CanvasFunctionType;
|
||||
|
||||
@@ -65,12 +65,13 @@ ol.source.ImageCanvas.prototype.getImage =
|
||||
var height = (extent[3] - extent[1]) / resolution;
|
||||
var size = [width * pixelRatio, height * pixelRatio];
|
||||
|
||||
var canvasElement = this.canvasFunction_(extent, resolution, size,
|
||||
projection);
|
||||
canvas = new ol.ImageCanvas(extent, resolution, pixelRatio,
|
||||
this.getAttributions(), canvasElement);
|
||||
var canvasElement = this.canvasFunction_(
|
||||
extent, resolution, pixelRatio, size, projection);
|
||||
if (!goog.isNull(canvasElement)) {
|
||||
canvas = new ol.ImageCanvas(extent, resolution, pixelRatio,
|
||||
this.getAttributions(), canvasElement);
|
||||
}
|
||||
this.canvas_ = canvas;
|
||||
|
||||
return canvas;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user