From 92469901f751ecd955be8d4f66decd481f8d5fd2 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 26 Nov 2013 12:15:40 +0100 Subject: [PATCH] Clone extents in ol.structs.RBush to prevent modification --- src/ol/structs/rbush.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/structs/rbush.js b/src/ol/structs/rbush.js index e52bf5ec50..88c21b6c73 100644 --- a/src/ol/structs/rbush.js +++ b/src/ol/structs/rbush.js @@ -495,7 +495,7 @@ ol.structs.RBush.prototype.insert = function(extent, value) { var key = this.getKey_(value); goog.asserts.assert(!this.valueExtent_.hasOwnProperty(key)); this.insert_(extent, value, this.root_.height - 1); - this.valueExtent_[key] = extent; + this.valueExtent_[key] = ol.extent.clone(extent); }; @@ -631,6 +631,6 @@ ol.structs.RBush.prototype.update = function(extent, value) { if (!ol.extent.equals(currentExtent, extent)) { this.remove_(currentExtent, value); this.insert_(extent, value, this.root_.height - 1); - this.valueExtent_[key] = extent; + ol.extent.clone(extent, currentExtent); } };