Merge pull request #6666 from fredj/cleanup
Use the optional extent in ol.structs.RBush#getExtent
This commit is contained in:
@@ -610,11 +610,13 @@ ol.source.Vector.prototype.getClosestFeatureToCoordinate = function(coordinate,
|
||||
*
|
||||
* This method is not available when the source is configured with
|
||||
* `useSpatialIndex` set to `false`.
|
||||
* @param {ol.Extent=} opt_extent Destination extent. If provided, no new extent
|
||||
* will be created. Instead, that extent's coordinates will be overwritten.
|
||||
* @return {!ol.Extent} Extent.
|
||||
* @api
|
||||
*/
|
||||
ol.source.Vector.prototype.getExtent = function() {
|
||||
return this.featuresRtree_.getExtent();
|
||||
ol.source.Vector.prototype.getExtent = function(opt_extent) {
|
||||
return this.featuresRtree_.getExtent(opt_extent);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -213,5 +213,5 @@ ol.structs.RBush.prototype.clear = function() {
|
||||
ol.structs.RBush.prototype.getExtent = function(opt_extent) {
|
||||
// FIXME add getExtent() to rbush
|
||||
var data = this.rbush_.data;
|
||||
return [data.minX, data.minY, data.maxX, data.maxY];
|
||||
return ol.extent.createOrUpdate(data.minX, data.minY, data.maxX, data.maxY, opt_extent);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user