Changeset 3087
- Timestamp:
- 04/19/07 16:00:15 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Layer/KaMap.js (modified) (1 diff)
- trunk/openlayers/tests/Layer/test_KaMap.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/KaMap.js
r2240 r3087 146 146 147 147 }, 148 149 /** 150 * @param {Object} obj 151 * 152 * @returns An exact clone of this OpenLayers.Layer.Grid 153 * @type OpenLayers.Layer.Grid 154 */ 155 clone: function (obj) { 156 157 if (obj == null) { 158 obj = new OpenLayers.Layer.KaMap(this.name, 159 this.url, 160 this.params, 161 this.options); 162 } 163 164 //get all additions from superclasses 165 obj = OpenLayers.Layer.Grid.prototype.clone.apply(this, [obj]); 166 167 // copy/set any non-init, non-simple values here 168 if (this.tileSize != null) { 169 obj.tileSize = this.tileSize.clone(); 170 } 171 172 // we do not want to copy reference to grid, so we make a new array 173 obj.grid = new Array(); 174 175 return obj; 176 }, 177 148 178 149 179 /** @final @type String */ trunk/openlayers/tests/Layer/test_KaMap.html
r2803 r3087 148 148 149 149 function test_10_Layer_KaMap_clone(t) { 150 t.plan( 4);150 t.plan(5); 151 151 152 152 var options = {tileSize: new OpenLayers.Size(500,50)}; … … 169 169 170 170 t.eq( clone.alpha, layer.alpha, "alpha copied correctly"); 171 172 t.eq( clone.CLASS_NAME, "OpenLayers.Layer.KaMap", "Clone is a ka-map layer"); 171 173 172 174 layer.grid = null;
