diff --git a/src/ol/replay/canvas/canvasreplay.js b/src/ol/replay/canvas/canvasreplay.js index af15d07112..78d6fd27bb 100644 --- a/src/ol/replay/canvas/canvasreplay.js +++ b/src/ol/replay/canvas/canvasreplay.js @@ -248,6 +248,31 @@ ol.replay.canvas.LineStringBatch.prototype.drawCoordinates_ = }; +/** + * @param {Array.} 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 */