Merge pull request #715 from ahocevar/rtree-performance
Making RTree's find more efficient. r=@bartvde
This commit is contained in:
@@ -59,8 +59,8 @@ ol.structs.RTreeNode_ = function(bounds, parent, level) {
|
|||||||
* @param {string=} opt_type Type for another indexing dimension.
|
* @param {string=} opt_type Type for another indexing dimension.
|
||||||
*/
|
*/
|
||||||
ol.structs.RTreeNode_.prototype.find = function(bounds, results, opt_type) {
|
ol.structs.RTreeNode_.prototype.find = function(bounds, results, opt_type) {
|
||||||
if (ol.extent.intersects(this.bounds, bounds) &&
|
if ((!goog.isDef(opt_type) || this.types[opt_type] === true) &&
|
||||||
(!goog.isDef(opt_type) || this.types[opt_type] === true)) {
|
ol.extent.intersects(this.bounds, bounds)) {
|
||||||
var numChildren = this.children.length;
|
var numChildren = this.children.length;
|
||||||
if (numChildren === 0) {
|
if (numChildren === 0) {
|
||||||
if (goog.isDef(this.object)) {
|
if (goog.isDef(this.object)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user