Port ol.geom to new extents

This commit is contained in:
Tom Payne
2013-04-16 16:27:28 +02:00
parent 01168e805a
commit 953f9c2e7a
10 changed files with 35 additions and 38 deletions

View File

@@ -62,10 +62,10 @@ describe('ol.geom.GeometryCollection', function() {
var line = new ol.geom.LineString([[1, 20], [30, 40]]);
var multi = new ol.geom.GeometryCollection([point, line]);
var bounds = multi.getBounds();
expect(bounds.minX).to.be(1);
expect(bounds.minY).to.be(2);
expect(bounds.maxX).to.be(30);
expect(bounds.maxY).to.be(40);
expect(bounds[0]).to.be(1);
expect(bounds[1]).to.be(30);
expect(bounds[2]).to.be(2);
expect(bounds[3]).to.be(40);
});
});

View File

@@ -45,10 +45,10 @@ describe('ol.geom.LineString', function() {
it('returns the bounding extent', function() {
var line = new ol.geom.LineString([[10, 20], [20, 30], [30, 40]]);
var bounds = line.getBounds();
expect(bounds.minX).to.be(10);
expect(bounds.minY).to.be(20);
expect(bounds.maxX).to.be(30);
expect(bounds.maxY).to.be(40);
expect(bounds[0]).to.be(10);
expect(bounds[1]).to.be(30);
expect(bounds[2]).to.be(20);
expect(bounds[3]).to.be(40);
});
});

View File

@@ -60,10 +60,10 @@ describe('ol.geom.MultiLineString', function() {
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
var bounds = multi.getBounds();
expect(bounds.minX).to.be(10);
expect(bounds.minY).to.be(20);
expect(bounds.maxX).to.be(40);
expect(bounds.maxY).to.be(50);
expect(bounds[0]).to.be(10);
expect(bounds[1]).to.be(40);
expect(bounds[2]).to.be(20);
expect(bounds[3]).to.be(50);
});
});

View File

@@ -50,10 +50,10 @@ describe('ol.geom.MultiPoint', function() {
it('returns the bounding extent', function() {
var multi = new ol.geom.MultiPoint([[10, 20], [30, 40]]);
var bounds = multi.getBounds();
expect(bounds.minX).to.be(10);
expect(bounds.minY).to.be(20);
expect(bounds.maxX).to.be(30);
expect(bounds.maxY).to.be(40);
expect(bounds[0]).to.be(10);
expect(bounds[1]).to.be(30);
expect(bounds[2]).to.be(20);
expect(bounds[3]).to.be(40);
});
});

View File

@@ -63,10 +63,10 @@ describe('ol.geom.MultiPolygon', function() {
[outer1, inner1a, inner1b],
[outer2]]);
var bounds = multi.getBounds();
expect(bounds.minX).to.be(0);
expect(bounds.minY).to.be(0);
expect(bounds.maxX).to.be(20);
expect(bounds.maxY).to.be(50);
expect(bounds[0]).to.be(0);
expect(bounds[1]).to.be(20);
expect(bounds[2]).to.be(0);
expect(bounds[3]).to.be(50);
});
});

View File

@@ -47,10 +47,10 @@ describe('ol.geom.Point', function() {
it('returns the bounding extent', function() {
var point = new ol.geom.Point([10, 20]);
var bounds = point.getBounds();
expect(bounds.minX).to.be(10);
expect(bounds.minY).to.be(20);
expect(bounds.maxX).to.be(10);
expect(bounds.maxY).to.be(20);
expect(bounds[0]).to.be(10);
expect(bounds[1]).to.be(10);
expect(bounds[2]).to.be(20);
expect(bounds[3]).to.be(20);
});
});

View File

@@ -64,10 +64,10 @@ describe('ol.geom.Polygon', function() {
it('returns the bounding extent', function() {
var poly = new ol.geom.Polygon([outer, inner1, inner2]);
var bounds = poly.getBounds();
expect(bounds.minX).to.be(0);
expect(bounds.minY).to.be(0);
expect(bounds.maxX).to.be(10);
expect(bounds.maxY).to.be(10);
expect(bounds[0]).to.be(0);
expect(bounds[1]).to.be(10);
expect(bounds[2]).to.be(0);
expect(bounds[3]).to.be(10);
});
});