Merge pull request #4809 from fperucic/multpolygon-clone
Fix multipolygon clone.
This commit is contained in:
committed by
Andreas Hocevar
parent
b4c4a81afb
commit
e8cd5e322f
@@ -122,7 +122,7 @@ ol.geom.MultiPolygon.prototype.clone = function() {
|
|||||||
var len = this.endss_.length;
|
var len = this.endss_.length;
|
||||||
var newEndss = new Array(len);
|
var newEndss = new Array(len);
|
||||||
for (var i = 0; i < len; ++i) {
|
for (var i = 0; i < len; ++i) {
|
||||||
newEndss[i] = this.endss_.slice();
|
newEndss[i] = this.endss_[i].slice();
|
||||||
}
|
}
|
||||||
|
|
||||||
multiPolygon.setFlatCoordinates(
|
multiPolygon.setFlatCoordinates(
|
||||||
|
|||||||
@@ -88,6 +88,15 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
[[[3, 0], [4, 1], [5, 2], [5, 0]]]);
|
[[[3, 0], [4, 1], [5, 2], [5, 0]]]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('#clone()', function() {
|
||||||
|
|
||||||
|
it('has the expected endss_', function() {
|
||||||
|
var clone = multiPolygon.clone();
|
||||||
|
expect(multiPolygon.endss_).to.eql(clone.endss_);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
describe('#getCoordinates()', function() {
|
describe('#getCoordinates()', function() {
|
||||||
|
|
||||||
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
|
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
|
||||||
|
|||||||
Reference in New Issue
Block a user