diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index f5be57fb87..1f0e5a76ce 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -63,12 +63,19 @@ OpenLayers.Layer.Grid.prototype = this.params, this.options); } - - // copy/set any non-init, non-simple values here - obj.tileSize = this.tileSize.copyOf(); - + //get all additions from superclasses - return OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this, [obj]); + obj = OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this, [obj]); + + // copy/set any non-init, non-simple values here + if (this.tileSize != null) { + obj.tileSize = this.tileSize.copyOf(); + } + + // we do not want to copy reference to grid. that should stay at null + obj.grid = null; + + return obj; }, /** When the layer is added to a map, then we can ask the map for