Add getBounds to geometry

This commit is contained in:
Tim Schaub
2013-01-21 12:59:04 -07:00
parent 216d30ddc1
commit b4d44f815f
16 changed files with 418 additions and 16 deletions

View File

@@ -19,7 +19,7 @@ describe('ol.geom.Polygon', function() {
});
describe('rings', function() {
describe('#rings', function() {
it('is an array of LinearRing', function() {
var poly = new ol.geom.Polygon([outer, inner1, inner2]);
@@ -32,7 +32,7 @@ describe('ol.geom.Polygon', function() {
});
describe('dimension', function() {
describe('#dimension', function() {
it('can be 2', function() {
var poly = new ol.geom.Polygon([outer, inner1, inner2]);
@@ -46,6 +46,19 @@ describe('ol.geom.Polygon', function() {
});
describe('#getBounds()', function() {
it('returns the bounding extent', function() {
var poly = new ol.geom.Polygon([outer, inner1, inner2]);
var bounds = poly.getBounds();
expect(bounds.minX).toBe(0);
expect(bounds.minY).toBe(0);
expect(bounds.maxX).toBe(10);
expect(bounds.maxY).toBe(10);
});
});
});