Update geom package to use new extent structure

This commit is contained in:
Tim Schaub
2013-09-03 17:40:34 -06:00
parent dbccb8b231
commit 60bf396e25
10 changed files with 35 additions and 45 deletions
+5 -15
View File
@@ -38,22 +38,12 @@ goog.inherits(ol.geom.AbstractCollection, ol.geom.Geometry);
*/
ol.geom.AbstractCollection.prototype.getBounds = function() {
if (goog.isNull(this.bounds)) {
var minX,
minY = minX = Infinity,
maxX,
maxY = maxX = -Infinity,
components = this.components,
len = components.length,
bounds, i;
for (i = 0; i < len; ++i) {
bounds = components[i].getBounds();
minX = Math.min(bounds[0], minX);
maxX = Math.max(bounds[1], maxX);
minY = Math.min(bounds[2], minY);
maxY = Math.max(bounds[3], maxY);
var bounds = ol.extent.createEmpty();
var components = this.components;
for (var i = 0, ii = components.length; i < ii; ++i) {
ol.extent.extend(bounds, components[i].getBounds());
}
this.bounds = [minX, maxX, minY, maxY];
this.bounds = bounds;
}
return this.bounds;
};