From 507fd0b86d282f8cd8071cbc094a943c8c7173e5 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 17 Sep 2009 13:08:52 +0000 Subject: [PATCH] change getDateExtent() so it does not break when the layer has features without geometry. p=fvanderbiest, r=me (closes #2267) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9674 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Vector.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 8ac538eda9..16751b4f57 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -807,14 +807,17 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { */ getDataExtent: function () { var maxExtent = null; - - if(this.features && (this.features.length > 0)) { + var features = this.features; + if(features && (features.length > 0)) { maxExtent = new OpenLayers.Bounds(); - for(var i=0, len=this.features.length; i