Add the missing this.layername in TileCache constructor (in clone function), add a unit test for this function (Closes #1180)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5328 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -71,8 +71,9 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
|||||||
|
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
obj = new OpenLayers.Layer.TileCache(this.name,
|
obj = new OpenLayers.Layer.TileCache(this.name,
|
||||||
this.url,
|
this.url,
|
||||||
this.options);
|
this.layername,
|
||||||
|
this.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
//get all additions from superclasses
|
//get all additions from superclasses
|
||||||
|
|||||||
@@ -18,7 +18,16 @@
|
|||||||
t.ok( layer instanceof OpenLayers.Layer.TileCache, "returns OpenLayers.Layer.TileCache object" );
|
t.ok( layer instanceof OpenLayers.Layer.TileCache, "returns OpenLayers.Layer.TileCache object" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test__Layer_TileCache_clone(t) {
|
||||||
|
t.plan(3);
|
||||||
|
|
||||||
|
layer = new OpenLayers.Layer.TileCache(name, url, layername, options);
|
||||||
|
|
||||||
|
var clone = layer.clone();
|
||||||
|
t.eq(layer.name, clone.name, "clone() correctly copy the 'name' property");
|
||||||
|
t.eq(layer.url, clone.url, "clone() correctly copy the 'url' property");
|
||||||
|
t.eq(layer.layername, clone.layername, "clone() correctly copy the 'layername' property");
|
||||||
|
}
|
||||||
|
|
||||||
function test_03_Layer_TileCache_clearTiles (t) {
|
function test_03_Layer_TileCache_clearTiles (t) {
|
||||||
t.plan( 1 );
|
t.plan( 1 );
|
||||||
|
|||||||
Reference in New Issue
Block a user