From 4de5cda4a13ca4196693a0ad73bd11f849364f06 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 25 Nov 2013 19:30:18 +0100 Subject: [PATCH] Keep R-Tree up-to-date in ol.source.Vector --- src/ol/source/vectorsource.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ol/source/vectorsource.js b/src/ol/source/vectorsource.js index b7913d3b61..b9039d16aa 100644 --- a/src/ol/source/vectorsource.js +++ b/src/ol/source/vectorsource.js @@ -1,7 +1,6 @@ // FIXME bulk feature upload - suppress events // FIXME put features in an ol.Collection // FIXME make change-detection more refined (notably, geometry hint) -// FIXME keep R-Tree up-to-date, probably needs a new R-Tree implementation goog.provide('ol.source.Vector'); @@ -129,8 +128,8 @@ ol.source.Vector.prototype.getAllFeaturesInExtent = function(extent) { * @private */ ol.source.Vector.prototype.handleFeatureChange_ = function(event) { - //var feature = /** @type {ol.Feature} */ (event.target); - // FIXME keep R-Tree up to date + var feature = /** @type {ol.Feature} */ (event.target); + this.rBush_.update(feature.getGeometry().getExtent(), feature); this.dispatchChangeEvent(); };