Pass pixel ratio to ol.render.canvas.ReplayGroup constructor
This commit is contained in:
@@ -1052,9 +1052,16 @@ ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyles_ = function() {
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @implements {ol.render.IReplayGroup}
|
* @implements {ol.render.IReplayGroup}
|
||||||
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @struct
|
* @struct
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.ReplayGroup = function() {
|
ol.render.canvas.ReplayGroup = function(pixelRatio) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.pixelRatio_ = pixelRatio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
|||||||
var vectorSource = vectorLayer.getVectorSource();
|
var vectorSource = vectorLayer.getVectorSource();
|
||||||
var frameStateExtent = frameState.extent;
|
var frameStateExtent = frameState.extent;
|
||||||
var frameStateResolution = frameState.view2DState.resolution;
|
var frameStateResolution = frameState.view2DState.resolution;
|
||||||
|
var pixelRatio = frameState.devicePixelRatio;
|
||||||
|
|
||||||
if (!this.dirty_ &&
|
if (!this.dirty_ &&
|
||||||
this.renderedResolution_ == frameStateResolution &&
|
this.renderedResolution_ == frameStateResolution &&
|
||||||
@@ -198,7 +199,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
|||||||
if (!goog.isDef(styleFunction)) {
|
if (!goog.isDef(styleFunction)) {
|
||||||
styleFunction = ol.layer.Vector.defaultStyleFunction;
|
styleFunction = ol.layer.Vector.defaultStyleFunction;
|
||||||
}
|
}
|
||||||
var replayGroup = new ol.render.canvas.ReplayGroup();
|
var replayGroup = new ol.render.canvas.ReplayGroup(pixelRatio);
|
||||||
vectorSource.forEachFeatureInExtent(extent,
|
vectorSource.forEachFeatureInExtent(extent,
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
|
|||||||
Reference in New Issue
Block a user