Port ol.geom to new extents
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user