Pass tolerance to ol.render.canvas.ReplayGroup constructor

This commit is contained in:
Tom Payne
2013-12-17 17:46:01 +01:00
parent 79ade07fb7
commit 76bddcf042
2 changed files with 10 additions and 2 deletions

View File

@@ -1063,9 +1063,10 @@ ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyles_ = function() {
* @constructor
* @implements {ol.render.IReplayGroup}
* @param {number} pixelRatio Pixel ratio.
* @param {number} tolerance Tolerance.
* @struct
*/
ol.render.canvas.ReplayGroup = function(pixelRatio) {
ol.render.canvas.ReplayGroup = function(pixelRatio, tolerance) {
/**
* @private
@@ -1073,6 +1074,12 @@ ol.render.canvas.ReplayGroup = function(pixelRatio) {
*/
this.pixelRatio_ = pixelRatio;
/**
* @private
* @type {number}
*/
this.tolerance_ = tolerance;
/**
* @private
* @type {Object.<string,

View File

@@ -199,7 +199,8 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
if (!goog.isDef(styleFunction)) {
styleFunction = ol.layer.Vector.defaultStyleFunction;
}
var replayGroup = new ol.render.canvas.ReplayGroup(pixelRatio);
var tolerance = frameStateResolution / (2 * pixelRatio);
var replayGroup = new ol.render.canvas.ReplayGroup(pixelRatio, tolerance);
vectorSource.forEachFeatureInExtent(extent,
/**
* @param {ol.Feature} feature Feature.