Add ol.replay.canvas.LineStringBatch#drawFlatCoordinates_

This commit is contained in:
Tom Payne
2013-11-09 17:13:05 +01:00
parent 335f24f398
commit 1afaa9b6af

View File

@@ -248,6 +248,31 @@ ol.replay.canvas.LineStringBatch.prototype.drawCoordinates_ =
};
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @private
*/
ol.replay.canvas.LineStringBatch.prototype.drawFlatCoordinates_ =
function(flatCoordinates, offset, end, stride) {
var state = this.state_;
if (!ol.style.stroke.equals(state.currentStrokeStyle, state.strokeStyle)) {
if (state.lastDraw != this.coordinates.length) {
this.instructions.push([ol.replay.canvas.Instruction.STROKE]);
}
this.instructions.push(
[ol.replay.canvas.Instruction.SET_STROKE_STYLE, state.strokeStyle],
[ol.replay.canvas.Instruction.BEGIN_PATH]);
state.currentStrokeStyle = state.strokeStyle;
}
var myEnd = this.appendFlatCoordinates(
flatCoordinates, offset, end, stride, false);
this.instructions.push([ol.replay.canvas.Instruction.MOVE_TO_LINE_TO, myEnd]);
};
/**
* @inheritDoc
*/