Fix ka-Map's clone method, to fix bug with Overview Map reported by Stephen

Woodbridge. (Thx Stephen.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3087 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-04-19 20:00:15 +00:00
parent 8a14f917dc
commit 28ba3309c1
2 changed files with 33 additions and 1 deletions

View File

@@ -145,6 +145,36 @@ OpenLayers.Layer.KaMap.prototype =
this.spiralTileLoad();
},
/**
* @param {Object} obj
*
* @returns An exact clone of this OpenLayers.Layer.Grid
* @type OpenLayers.Layer.Grid
*/
clone: function (obj) {
if (obj == null) {
obj = new OpenLayers.Layer.KaMap(this.name,
this.url,
this.params,
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
if (this.tileSize != null) {
obj.tileSize = this.tileSize.clone();
}
// we do not want to copy reference to grid, so we make a new array
obj.grid = new Array();
return obj;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Layer.KaMap"