give Grid a clone() function.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@894 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-06 02:19:04 +00:00
parent 8c6972bb06
commit 90933052aa

View File

@@ -47,6 +47,27 @@ OpenLayers.Layer.Grid.prototype =
OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this, arguments);
},
/**
* @param {Object} obj
*
* @returns An exact clone of this OpenLayers.Layer.Grid
* @type OpenLayers.Layer.Grid
*/
clone: function (obj) {
if (obj == null) {
obj = new OpenLayers.Layer.Grid(this.name,
this.url,
this.params,
this.options);
}
//set any non-init vars here
//get all additions from superclasses
return OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this, [obj]);
},
/** When the layer is added to a map, then we can ask the map for
* its default tile size
*