From 3b929fd7a2a17415c60cf30537a59d60b804cae9 Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 9 Aug 2006 06:14:05 +0000 Subject: [PATCH] clean up clearGrid() git-svn-id: http://svn.openlayers.org/trunk/openlayers@1150 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Grid.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 0eee16e368..b9eaab1937 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -360,14 +360,11 @@ OpenLayers.Layer.Grid.prototype = */ clearGrid:function() { if (this.grid) { - while(this.grid.length > 0) { - var row = this.grid[0]; - while(row.length > 0) { - var tile = row[0]; - tile.destroy(); - row.remove(tile); + for(var iRow=0; iRow < this.grid.length; iRow++) { + var row = this.grid[iRow]; + for(var iCol=0; iCol < row.length; iCol++) { + row[iCol].clear(); } - this.grid.remove(row); } } },