Add clone methods to Tile and Tile.Image, and add associated tests. r=crschmidt (closes #1296)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5854 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -119,6 +119,30 @@ OpenLayers.Tile = OpenLayers.Class({
|
||||
this.events.destroy();
|
||||
this.events = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: clone
|
||||
*
|
||||
* Parameters:
|
||||
* obj - {<OpenLayers.Tile>} The tile to be cloned
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Tile>} An exact clone of this <OpenLayers.Tile>
|
||||
*/
|
||||
clone: function (obj) {
|
||||
if (obj == null) {
|
||||
obj = new OpenLayers.Tile(this.layer,
|
||||
this.position,
|
||||
this.bounds,
|
||||
this.url,
|
||||
this.size);
|
||||
}
|
||||
|
||||
// catch any randomly tagged-on properties
|
||||
OpenLayers.Util.applyDefaults(obj, this);
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: draw
|
||||
|
||||
Reference in New Issue
Block a user