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:
@@ -91,6 +91,34 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
OpenLayers.Tile.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: clone
|
||||
*
|
||||
* Parameters:
|
||||
* obj - {<OpenLayers.Tile.Image>} The tile to be cloned
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Tile.Image>} An exact clone of this <OpenLayers.Tile.Image>
|
||||
*/
|
||||
clone: function (obj) {
|
||||
if (obj == null) {
|
||||
obj = new OpenLayers.Tile.Image(this.layer,
|
||||
this.position,
|
||||
this.bounds,
|
||||
this.url,
|
||||
this.size);
|
||||
}
|
||||
|
||||
//pick up properties from superclass
|
||||
obj = OpenLayers.Tile.prototype.clone.apply(this, [obj]);
|
||||
|
||||
//dont want to directly copy the image div
|
||||
obj.imgDiv = null;
|
||||
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: draw
|
||||
* Check that a tile should be drawn, and draw it.
|
||||
|
||||
Reference in New Issue
Block a user