diff --git a/src/ol/geom/abstractcollection.js b/src/ol/geom/abstractcollection.js index 800c5d47ff..65bbef6dcd 100644 --- a/src/ol/geom/abstractcollection.js +++ b/src/ol/geom/abstractcollection.js @@ -1,6 +1,5 @@ goog.provide('ol.geom.AbstractCollection'); -goog.require('ol.Extent'); goog.require('ol.geom.Geometry'); @@ -49,12 +48,12 @@ ol.geom.AbstractCollection.prototype.getBounds = function() { for (i = 0; i < len; ++i) { bounds = components[i].getBounds(); - minX = Math.min(bounds.minX, minX); - minY = Math.min(bounds.minY, minY); - maxX = Math.max(bounds.maxX, maxX); - maxY = Math.max(bounds.maxY, maxY); + minX = Math.min(bounds[0], minX); + maxX = Math.max(bounds[1], maxX); + minY = Math.min(bounds[2], minY); + maxY = Math.max(bounds[3], maxY); } - this.bounds = new ol.Extent(minX, minY, maxX, maxY); + this.bounds = [minX, maxX, minY, maxY]; } return this.bounds; }; diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js index 1705954163..7f92785690 100644 --- a/src/ol/geom/linestring.js +++ b/src/ol/geom/linestring.js @@ -1,7 +1,6 @@ goog.provide('ol.geom.LineString'); goog.require('goog.asserts'); -goog.require('ol.Extent'); goog.require('ol.geom.Geometry'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.SharedVertices'); @@ -126,7 +125,7 @@ ol.geom.LineString.prototype.getBounds = function() { maxY = y; } } - this.bounds_ = new ol.Extent(minX, minY, maxX, maxY); + this.bounds_ = [minX, maxX, minY, maxY]; } return this.bounds_; }; diff --git a/src/ol/geom/point.js b/src/ol/geom/point.js index f593db0cb7..97d3ed7a34 100644 --- a/src/ol/geom/point.js +++ b/src/ol/geom/point.js @@ -1,7 +1,6 @@ goog.provide('ol.geom.Point'); goog.require('goog.asserts'); -goog.require('ol.Extent'); goog.require('ol.geom.Geometry'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.SharedVertices'); @@ -69,7 +68,7 @@ ol.geom.Point.prototype.getBounds = function() { if (goog.isNull(this.bounds_)) { var x = this.get(0), y = this.get(1); - this.bounds_ = new ol.Extent(x, y, x, y); + this.bounds_ = [x, x, y, y]; } return this.bounds_; }; diff --git a/test/spec/ol/geom/geometrycollection.test.js b/test/spec/ol/geom/geometrycollection.test.js index 16dd937b03..d9c1616c33 100644 --- a/test/spec/ol/geom/geometrycollection.test.js +++ b/test/spec/ol/geom/geometrycollection.test.js @@ -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); }); }); diff --git a/test/spec/ol/geom/linestring.test.js b/test/spec/ol/geom/linestring.test.js index 7c66f986b8..22e7c16d84 100644 --- a/test/spec/ol/geom/linestring.test.js +++ b/test/spec/ol/geom/linestring.test.js @@ -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); }); }); diff --git a/test/spec/ol/geom/multilinestring.test.js b/test/spec/ol/geom/multilinestring.test.js index 3b1ea32db8..a63f6fa64f 100644 --- a/test/spec/ol/geom/multilinestring.test.js +++ b/test/spec/ol/geom/multilinestring.test.js @@ -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); }); }); diff --git a/test/spec/ol/geom/multipoint.test.js b/test/spec/ol/geom/multipoint.test.js index 6e4b4fa0e7..c1b1f7098f 100644 --- a/test/spec/ol/geom/multipoint.test.js +++ b/test/spec/ol/geom/multipoint.test.js @@ -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); }); }); diff --git a/test/spec/ol/geom/multipolygon.test.js b/test/spec/ol/geom/multipolygon.test.js index a0a300b1a6..66acc83f1a 100644 --- a/test/spec/ol/geom/multipolygon.test.js +++ b/test/spec/ol/geom/multipolygon.test.js @@ -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); }); }); diff --git a/test/spec/ol/geom/point.test.js b/test/spec/ol/geom/point.test.js index 9e5093fdee..1b00029a7e 100644 --- a/test/spec/ol/geom/point.test.js +++ b/test/spec/ol/geom/point.test.js @@ -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); }); }); diff --git a/test/spec/ol/geom/polygon.test.js b/test/spec/ol/geom/polygon.test.js index 4871a9536e..ea18f84339 100644 --- a/test/spec/ol/geom/polygon.test.js +++ b/test/spec/ol/geom/polygon.test.js @@ -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); }); });