Add MultiPolygon drawing to batch

This commit is contained in:
Tom Payne
2013-11-08 16:36:50 +01:00
parent cb099cb453
commit f0a27ceaf0
2 changed files with 35 additions and 0 deletions

View File

@@ -209,6 +209,33 @@ ol.replay.canvas.Batch.prototype.drawMultiLineStringGeometry =
};
/**
* @inheritDoc
*/
ol.replay.canvas.Batch.prototype.drawMultiPolygonGeometry =
function(multiPolygonGeometry) {
goog.asserts.assert(!goog.isNull(this.state_));
var ringss = multiPolygonGeometry.getRingss();
var i, ii;
for (i = 0, ii = ringss.length; i < ii; ++i) {
var rings = ringss[i];
var j, jj;
for (j = 0, jj = rings.length; j < jj; ++j) {
this.beginPath_();
this.instructions_.push({
type: ol.replay.canvas.InstructionType.MOVE_TO_LINE_TO,
argument: this.appendCoordinates_(rings[j], true)
});
this.instructions_.push({
type: ol.replay.canvas.InstructionType.CLOSE_PATH
});
}
}
this.state_.fillPending = true;
this.state_.strokePending = true;
};
/**
* @inheritDoc
*/

View File

@@ -41,6 +41,14 @@ ol.replay.IBatch.prototype.drawMultiLineStringGeometry =
};
/**
* @param {ol.geom.MultiPolygon} multiPolygonGeometry Multi polygon geometry.
*/
ol.replay.IBatch.prototype.drawMultiPolygonGeometry =
function(multiPolygonGeometry) {
};
/**
* @param {ol.geom.Polygon} polygonGeometry Polygon geometry.
*/