From 43dd65d35782bdc05c4456d5b043dd5a0a12ae28 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 7 Dec 2010 23:37:56 +0000 Subject: [PATCH] Avoiding infinite recursion when getting bounds of geometry collections. r=ahocevar (closes #2967) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10953 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Geometry/Collection.js | 15 +++++++++++---- tests/Geometry/Collection.html | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Geometry/Collection.js b/lib/OpenLayers/Geometry/Collection.js index 39be8d74a2..aa5f987476 100644 --- a/lib/OpenLayers/Geometry/Collection.js +++ b/lib/OpenLayers/Geometry/Collection.js @@ -108,12 +108,19 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, { */ calculateBounds: function() { this.bounds = null; - if ( this.components && this.components.length > 0) { - this.setBounds(this.components[0].getBounds()); - for (var i=1, len=this.components.length; i