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

@@ -15,7 +15,7 @@ describe('ol.geom.LineString', function() {
});
describe('coordinates', function() {
describe('#coordinates', function() {
it('is a Float64Array', function() {
var line = new ol.geom.LineString([[10, 20], [30, 40]]);
@@ -30,7 +30,7 @@ describe('ol.geom.LineString', function() {
});
describe('dimension', function() {
describe('#dimension', function() {
it('can be 2', function() {
var line = new ol.geom.LineString([[10, 20], [30, 40]]);
@@ -44,6 +44,19 @@ describe('ol.geom.LineString', function() {
});
describe('#getBounds()', 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).toBe(10);
expect(bounds.minY).toBe(20);
expect(bounds.maxX).toBe(30);
expect(bounds.maxY).toBe(40);
});
});
});