Adding original properties to cloned geometry

This commit is contained in:
Michał Zielański
2020-08-26 15:11:11 +02:00
parent 62842d5508
commit 8e0a61ac5f
12 changed files with 45 additions and 5 deletions
@@ -97,6 +97,7 @@ describe('ol.geom.GeometryCollection', function () {
]);
const poly = new Polygon([outer, inner1, inner2]);
const multi = new GeometryCollection([point, line, poly]);
multi.setProperties({foo: 'bar', baz: null});
const clone = multi.clone();
expect(clone).to.not.be(multi);
const geometries = clone.getGeometries();
@@ -106,6 +107,7 @@ describe('ol.geom.GeometryCollection', function () {
[30, 40],
]);
expect(geometries[2].getCoordinates()).to.eql([outer, inner1, inner2]);
expect(clone.getProperties()).to.eql({foo: 'bar', baz: null});
});
it('does a deep clone', function () {