Pass pixel ratio to ol.renderer.canvas.VectorLayer#renderFeature

This commit is contained in:
Tom Payne
2013-12-14 11:25:47 +01:00
parent 9b1a5f512d
commit 20e51a5e34

View File

@@ -206,8 +206,8 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
*/
function(feature) {
this.dirty_ = this.dirty_ ||
this.renderFeature(feature, frameStateResolution, styleFunction,
replayGroup);
this.renderFeature(feature, frameStateResolution, pixelRatio,
styleFunction, replayGroup);
}, this);
replayGroup.finish();
@@ -224,12 +224,13 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
/**
* @param {ol.Feature} feature Feature.
* @param {number} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {ol.style.StyleFunction} styleFunction Style function.
* @param {ol.render.canvas.ReplayGroup} replayGroup Replay group.
* @return {boolean} `true` if an image is loading.
*/
ol.renderer.canvas.VectorLayer.prototype.renderFeature =
function(feature, resolution, styleFunction, replayGroup) {
function(feature, resolution, pixelRatio, styleFunction, replayGroup) {
var loading = false;
var styles = styleFunction(feature, resolution);
// FIXME if styles is null, should we use the default style?