Add ol.geom.MultiLineString#appendLineString

This commit is contained in:
Tom Payne
2014-03-10 16:18:12 +01:00
parent 7ee4fb8a2e
commit 7a51b4c7b6
3 changed files with 28 additions and 0 deletions

View File

@@ -37,6 +37,17 @@ describe('ol.geom.MultiLineString', function() {
expect(multiLineString.getStride()).to.be(2);
});
it('can append line strings', function() {
multiLineString.appendLineString(
new ol.geom.LineString([[1, 2], [3, 4]]));
expect(multiLineString.getCoordinates()).to.eql(
[[[1, 2], [3, 4]]]);
multiLineString.appendLineString(
new ol.geom.LineString([[5, 6], [7, 8]]));
expect(multiLineString.getCoordinates()).to.eql(
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]);
});
});
describe('construct with 2D coordinates', function() {