From 7594f05c5794e4743281c740da64deec86b2cfc7 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Fri, 8 Nov 2013 03:05:38 +0100 Subject: [PATCH] Add MultiLineString drawing to batch --- src/ol/replay/canvas/canvasbatchgroup.js | 20 ++++++++++++++++++++ src/ol/replay/ibatchgroup.js | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/src/ol/replay/canvas/canvasbatchgroup.js b/src/ol/replay/canvas/canvasbatchgroup.js index 68afd68682..5e6f234c86 100644 --- a/src/ol/replay/canvas/canvasbatchgroup.js +++ b/src/ol/replay/canvas/canvasbatchgroup.js @@ -189,6 +189,26 @@ ol.replay.canvas.Batch.prototype.drawLineStringGeometry = }; +/** + * @inheritDoc + */ +ol.replay.canvas.Batch.prototype.drawMultiLineStringGeometry = + function(multiLineStringGeometry) { + goog.asserts.assert(!goog.isNull(this.state_)); + var coordinatess = multiLineStringGeometry.getCoordinatess(); + var i, ii; + for (i = 0, ii = coordinatess.length; i < ii; ++i) { + this.beginPath_(); + var end = this.appendCoordinates_(coordinatess[i], false); + this.instructions_.push({ + type: ol.replay.canvas.InstructionType.MOVE_TO_LINE_TO, + argument: end + }); + } + this.state_.strokePending = true; +}; + + /** * @inheritDoc */ diff --git a/src/ol/replay/ibatchgroup.js b/src/ol/replay/ibatchgroup.js index c0339bf2e6..11a5ed0fc4 100644 --- a/src/ol/replay/ibatchgroup.js +++ b/src/ol/replay/ibatchgroup.js @@ -32,6 +32,15 @@ ol.replay.IBatch.prototype.drawLineStringGeometry = }; +/** + * @param {ol.geom.MultiLineString} multiLineStringGeometry + * Multi line string geometry. + */ +ol.replay.IBatch.prototype.drawMultiLineStringGeometry = + function(multiLineStringGeometry) { +}; + + /** * @param {ol.geom.Polygon} polygonGeometry Polygon geometry. */