Fixing RTree, and using it for retrieving geometries

This commit is contained in:
ahocevar
2013-02-13 12:29:14 +01:00
parent 5bbd8fd9f3
commit e155f870cd
2 changed files with 14 additions and 20 deletions

View File

@@ -57,7 +57,9 @@ ol.RTreeNode_.prototype.find = function(bounds, results) {
if (this.intersects(bounds)) {
var numChildren = this.children.length;
if (numChildren === 0) {
results[this.objectId] = this.object;
if (goog.isDef(this.object)) {
results[this.objectId] = this.object;
}
} else {
for (var i = 0; i < numChildren; ++i) {
this.children[i].find(bounds, results);