Remove dimension property from geometries
This was only necessary when using the shared vertices structure.
This commit is contained in:
@@ -36,25 +36,6 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var point = new ol.geom.Point([10, 20]);
|
||||
var line = new ol.geom.LineString([[10, 20], [30, 40]]);
|
||||
var poly = new ol.geom.Polygon([outer, inner1, inner2]);
|
||||
var multi = new ol.geom.GeometryCollection([point, line, poly]);
|
||||
expect(multi.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var multi = new ol.geom.GeometryCollection([
|
||||
new ol.geom.Point([30, 40, 50])
|
||||
]);
|
||||
expect(multi.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#clone()', function() {
|
||||
|
||||
it('has a working clone method', function() {
|
||||
|
||||
@@ -11,20 +11,6 @@ describe('ol.geom.LinearRing', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20], [30, 40]]);
|
||||
expect(ring.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20, 30], [40, 50, 60]]);
|
||||
expect(ring.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getCoordinates()', function() {
|
||||
|
||||
it('is an array', function() {
|
||||
|
||||
@@ -12,20 +12,6 @@ describe('ol.geom.LineString', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var line = new ol.geom.LineString([[10, 20], [30, 40]]);
|
||||
expect(line.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var line = new ol.geom.LineString([[10, 20, 30], [40, 50, 60]]);
|
||||
expect(line.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getBounds()', function() {
|
||||
|
||||
it('returns the bounding extent', function() {
|
||||
|
||||
@@ -12,13 +12,6 @@ describe('ol.geom.MultiLineString', function() {
|
||||
expect(multi).to.be.a(ol.geom.Geometry);
|
||||
});
|
||||
|
||||
it('throws when given with insufficient dimensions', function() {
|
||||
expect(function() {
|
||||
var multi = new ol.geom.MultiLineString([1]);
|
||||
multi = multi; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#components', function() {
|
||||
@@ -36,24 +29,6 @@ describe('ol.geom.MultiLineString', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var multi = new ol.geom.MultiLineString([
|
||||
[[10, 20], [30, 40]],
|
||||
[[20, 30], [40, 50]]]);
|
||||
expect(multi.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var multi = new ol.geom.MultiLineString([
|
||||
[[10, 20, 30], [30, 40, 50]],
|
||||
[[20, 30, 40], [40, 50, 60]]]);
|
||||
expect(multi.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getBounds()', function() {
|
||||
|
||||
it('returns the bounding extent', function() {
|
||||
|
||||
@@ -10,13 +10,6 @@ describe('ol.geom.MultiPoint', function() {
|
||||
expect(multi).to.be.a(ol.geom.Geometry);
|
||||
});
|
||||
|
||||
it('throws when given with insufficient dimensions', function() {
|
||||
expect(function() {
|
||||
var multi = new ol.geom.MultiPoint([1]);
|
||||
multi = multi; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#components', function() {
|
||||
@@ -32,20 +25,6 @@ describe('ol.geom.MultiPoint', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var multi = new ol.geom.MultiPoint([[10, 20], [30, 40]]);
|
||||
expect(multi.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var multi = new ol.geom.MultiPoint([[10, 20, 30], [30, 40, 50]]);
|
||||
expect(multi.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getBounds()', function() {
|
||||
|
||||
it('returns the bounding extent', function() {
|
||||
|
||||
@@ -41,22 +41,6 @@ describe('ol.geom.MultiPolygon', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var multi = new ol.geom.MultiPolygon([
|
||||
[outer1, inner1a, inner1b],
|
||||
[outer2]]);
|
||||
expect(multi.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var multi = new ol.geom.MultiPolygon([[[[10, 20, 30], [40, 50, 60]]]]);
|
||||
expect(multi.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getBounds()', function() {
|
||||
|
||||
it('returns the bounding extent', function() {
|
||||
|
||||
@@ -10,27 +10,6 @@ describe('ol.geom.Point', function() {
|
||||
expect(point).to.be.a(ol.geom.Geometry);
|
||||
});
|
||||
|
||||
it('throws when given with insufficient dimensions', function() {
|
||||
expect(function() {
|
||||
var point = new ol.geom.Point([1]);
|
||||
point = point; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var point = new ol.geom.Point([10, 20]);
|
||||
expect(point.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var point = new ol.geom.Point([10, 20, 30]);
|
||||
expect(point.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getBounds()', function() {
|
||||
|
||||
@@ -51,20 +51,6 @@ describe('ol.geom.Polygon', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#dimension', function() {
|
||||
|
||||
it('can be 2', function() {
|
||||
var poly = new ol.geom.Polygon([outer, inner1, inner2]);
|
||||
expect(poly.dimension).to.be(2);
|
||||
});
|
||||
|
||||
it('can be 3', function() {
|
||||
var poly = new ol.geom.Polygon([[[10, 20, 30], [40, 50, 60]]]);
|
||||
expect(poly.dimension).to.be(3);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getBounds()', function() {
|
||||
|
||||
it('returns the bounding extent', function() {
|
||||
|
||||
@@ -15,7 +15,6 @@ describe('ol.parser.KML', function() {
|
||||
var geom = obj.features[0].getGeometry();
|
||||
expect(obj.features[0].getId()).to.eql('KML.Polygon');
|
||||
expect(geom instanceof ol.geom.Polygon).to.be.ok();
|
||||
expect(geom.dimension).to.eql(3);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -28,7 +27,6 @@ describe('ol.parser.KML', function() {
|
||||
expect(obj.features.length).to.eql(2);
|
||||
var geom = obj.features[0].getGeometry();
|
||||
expect(geom instanceof ol.geom.LineString).to.be.ok();
|
||||
expect(geom.dimension).to.eql(3);
|
||||
geom = obj.features[1].getGeometry();
|
||||
expect(geom instanceof ol.geom.LineString).to.be.ok();
|
||||
done();
|
||||
@@ -43,7 +41,6 @@ describe('ol.parser.KML', function() {
|
||||
expect(obj.features.length).to.eql(1);
|
||||
var geom = obj.features[0].getGeometry();
|
||||
expect(geom instanceof ol.geom.Point).to.be.ok();
|
||||
expect(geom.dimension).to.eql(3);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user