Pass tolerance to ol.render.canvas.Replay constructors
This commit is contained in:
@@ -42,10 +42,11 @@ ol.render.canvas.Instruction = {
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @implements {ol.render.IRender}
|
* @implements {ol.render.IRender}
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
|
* @param {number} tolerance Tolerance.
|
||||||
* @protected
|
* @protected
|
||||||
* @struct
|
* @struct
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.Replay = function(pixelRatio) {
|
ol.render.canvas.Replay = function(pixelRatio, tolerance) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
@@ -53,6 +54,12 @@ ol.render.canvas.Replay = function(pixelRatio) {
|
|||||||
*/
|
*/
|
||||||
this.pixelRatio = pixelRatio;
|
this.pixelRatio = pixelRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @protected
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.tolerance = tolerance;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<*>}
|
* @type {Array.<*>}
|
||||||
@@ -438,12 +445,13 @@ ol.render.canvas.Replay.prototype.setTextStyle = goog.abstractMethod;
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.render.canvas.Replay}
|
* @extends {ol.render.canvas.Replay}
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
|
* @param {number} tolerance Tolerance.
|
||||||
* @protected
|
* @protected
|
||||||
* @struct
|
* @struct
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.ImageReplay = function(pixelRatio) {
|
ol.render.canvas.ImageReplay = function(pixelRatio, tolerance) {
|
||||||
|
|
||||||
goog.base(this, pixelRatio);
|
goog.base(this, pixelRatio, tolerance);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -597,12 +605,13 @@ ol.render.canvas.ImageReplay.prototype.setImageStyle = function(imageStyle) {
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.render.canvas.Replay}
|
* @extends {ol.render.canvas.Replay}
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
|
* @param {number} tolerance Tolerance.
|
||||||
* @protected
|
* @protected
|
||||||
* @struct
|
* @struct
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.LineStringReplay = function(pixelRatio) {
|
ol.render.canvas.LineStringReplay = function(pixelRatio, tolerance) {
|
||||||
|
|
||||||
goog.base(this, pixelRatio);
|
goog.base(this, pixelRatio, tolerance);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -800,12 +809,13 @@ ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle =
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.render.canvas.Replay}
|
* @extends {ol.render.canvas.Replay}
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
|
* @param {number} tolerance Tolerance.
|
||||||
* @protected
|
* @protected
|
||||||
* @struct
|
* @struct
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.PolygonReplay = function(pixelRatio) {
|
ol.render.canvas.PolygonReplay = function(pixelRatio, tolerance) {
|
||||||
|
|
||||||
goog.base(this, pixelRatio);
|
goog.base(this, pixelRatio, tolerance);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -1272,7 +1282,7 @@ ol.render.canvas.ReplayGroup.prototype.getReplay =
|
|||||||
if (!goog.isDef(replay)) {
|
if (!goog.isDef(replay)) {
|
||||||
var constructor = ol.render.canvas.BATCH_CONSTRUCTORS_[replayType];
|
var constructor = ol.render.canvas.BATCH_CONSTRUCTORS_[replayType];
|
||||||
goog.asserts.assert(goog.isDef(constructor));
|
goog.asserts.assert(goog.isDef(constructor));
|
||||||
replay = new constructor(this.pixelRatio_);
|
replay = new constructor(this.pixelRatio_, this.tolerance_);
|
||||||
replayes[replayType] = replay;
|
replayes[replayType] = replay;
|
||||||
}
|
}
|
||||||
return replay;
|
return replay;
|
||||||
@@ -1291,7 +1301,7 @@ ol.render.canvas.ReplayGroup.prototype.isEmpty = function() {
|
|||||||
* @const
|
* @const
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<ol.render.ReplayType,
|
* @type {Object.<ol.render.ReplayType,
|
||||||
* function(new: ol.render.canvas.Replay, number)>}
|
* function(new: ol.render.canvas.Replay, number, number)>}
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.BATCH_CONSTRUCTORS_ = {
|
ol.render.canvas.BATCH_CONSTRUCTORS_ = {
|
||||||
'Image': ol.render.canvas.ImageReplay,
|
'Image': ol.render.canvas.ImageReplay,
|
||||||
|
|||||||
Reference in New Issue
Block a user