Accept polygons and flat coordinates in MultiPolygon constructor
This commit is contained in:
@@ -4,22 +4,17 @@ import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||
|
||||
describe('ol.geom.MultiPolygon', function() {
|
||||
|
||||
it('can be constructed with a null geometry', function() {
|
||||
it('cannot be constructed with a null geometry', function() {
|
||||
expect(function() {
|
||||
return new MultiPolygon(null);
|
||||
}).not.to.throwException();
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
describe('with a null MultiPolygon', function() {
|
||||
|
||||
let multiPolygon;
|
||||
beforeEach(function() {
|
||||
multiPolygon = new MultiPolygon(null);
|
||||
});
|
||||
|
||||
it('can append polygons', function() {
|
||||
multiPolygon.appendPolygon(
|
||||
new Polygon([[[0, 0], [0, 2], [1, 1], [2, 0]]]));
|
||||
const multiPolygon = new MultiPolygon([
|
||||
new Polygon([[[0, 0], [0, 2], [1, 1], [2, 0]]])]);
|
||||
expect(multiPolygon.getCoordinates()).to.eql(
|
||||
[[[[0, 0], [0, 2], [1, 1], [2, 0]]]]);
|
||||
multiPolygon.appendPolygon(
|
||||
|
||||
Reference in New Issue
Block a user