update WFS to new clone()

git-svn-id: http://svn.openlayers.org/trunk/openlayers@957 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-17 12:59:12 +00:00
parent 0bcf214ddc
commit 7994088a7a
+17 -11
View File
@@ -83,23 +83,29 @@ OpenLayers.Layer.WFS.prototype =
}, },
/** /**
* @param {String} name * @param {Object} obj
* @param {hash} params
* *
* @returns A clone of this OpenLayers.Layer.WMS, with the passed-in * @returns An exact clone of this OpenLayers.Layer.WMS
* parameters merged in.
* @type OpenLayers.Layer.WMS * @type OpenLayers.Layer.WMS
*/ */
clone: function (name, params) { clone: function (obj) {
var mergedParams = {}
Object.extend(mergedParams, this.params); if (obj == null) {
Object.extend(mergedParams, params); obj = new OpenLayers.Layer.WFS(this.name,
var obj = new OpenLayers.Layer.WFS(name, this.url, mergedParams); this.url,
if (this.tileSize) this.params,
obj.setTileSize(this.tileSize); this.options);
}
//get all additions from superclasses
obj = OpenLayers.Layer.Grid.prototype.clone.apply(this, [obj]);
// copy/set any non-init, non-simple values here
return obj; return obj;
}, },
/** /**
* addTile creates a tile, initializes it (via 'draw' in this case), and * addTile creates a tile, initializes it (via 'draw' in this case), and
* adds it to the layer div. * adds it to the layer div.