#856 - fix up clone method for vector features - give the geometry base class a clone (though it will likely never be used)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3788 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-07-23 19:54:58 +00:00
parent fd4d2918f1
commit 892a4042a1
4 changed files with 51 additions and 10 deletions

View File

@@ -98,19 +98,16 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
/**
* Method: clone
* Create a clone of this vector feature. Does not set any non-standard
* properties.
*
* Returns:
* <OpenLayers.Feature> An exact clone of this OpenLayers.Feature
* {<OpenLayers.Feature.Vector>} An exact clone of this vector feature.
*/
clone: function (obj) {
if (obj == null) {
obj = new OpenLayers.Feature(null, this.geometry.clone(), this.data);
}
// catch any randomly tagged-on properties
OpenLayers.Util.applyDefaults(obj, this);
return obj;
clone: function () {
return new OpenLayers.Feature.Vector(this.geometry.clone(),
this.attributes,
this.style);
},
/**