#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:
@@ -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);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user