Only query RTree if requested geometryType is used

This commit is contained in:
ahocevar
2013-05-19 11:16:02 +02:00
parent 79e4ee2717
commit 2ff2e85fbb

View File

@@ -102,8 +102,9 @@ ol.layer.FeatureCache.prototype.getFeaturesObject = function(opt_filter) {
}
}
if (extentFilter && geometryFilter) {
features = this.rTree_.find(
extentFilter.getExtent(), geometryFilter.getType());
var type = geometryFilter.getType();
features = goog.object.isEmpty(this.geometryTypeIndex_[type]) ? {} :
this.rTree_.find(extentFilter.getExtent(), type);
}
}
}