Allow replaying with null transform
This commit is contained in:
@@ -89,7 +89,7 @@ ol.render.canvas.Replay = function(tolerance, maxExtent, resolution, overlaps) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Transform}
|
||||
* @type {!ol.Transform}
|
||||
*/
|
||||
this.renderedTransform_ = ol.transform.create();
|
||||
|
||||
@@ -103,17 +103,17 @@ ol.render.canvas.Replay = function(tolerance, maxExtent, resolution, overlaps) {
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
*/
|
||||
this.pixelCoordinates_ = [];
|
||||
this.pixelCoordinates_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Transform}
|
||||
* @type {!ol.Transform}
|
||||
*/
|
||||
this.tmpLocalTransform_ = ol.transform.create();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Transform}
|
||||
* @type {!ol.Transform}
|
||||
*/
|
||||
this.resetTransform_ = ol.transform.create();
|
||||
};
|
||||
@@ -229,9 +229,12 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
||||
instructions, featureCallback, opt_hitExtent) {
|
||||
/** @type {Array.<number>} */
|
||||
var pixelCoordinates;
|
||||
if (ol.array.equals(transform, this.renderedTransform_)) {
|
||||
if (this.pixelCoordinates_ && ol.array.equals(transform, this.renderedTransform_)) {
|
||||
pixelCoordinates = this.pixelCoordinates_;
|
||||
} else {
|
||||
if (!this.pixelCoordinates_) {
|
||||
this.pixelCoordinates_ = [];
|
||||
}
|
||||
pixelCoordinates = ol.geom.flat.transform.transform2D(
|
||||
this.coordinates, 0, this.coordinates.length, 2,
|
||||
transform, this.pixelCoordinates_);
|
||||
|
||||
@@ -360,7 +360,7 @@ ol.MapOptionsInternal;
|
||||
/**
|
||||
* An array representing an affine 2d transformation for use with
|
||||
* {@link ol.transform} functions. The array has 6 elements.
|
||||
* @typedef {Array.<number>}
|
||||
* @typedef {!Array.<number>}
|
||||
*/
|
||||
ol.Transform;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user