Added setTileSize() method to Layer.Grid. Also, added clone() method to Layer.WMS to make up for lack of a separate data source class.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@63 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-05-16 22:26:47 +00:00
parent 8218798cf9
commit 55732b8934
2 changed files with 18 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
// this is an array of rows, each row is an array of tiles
grid: null,
DEFAULT_TILE_SIZE: new OpenLayers.Size(256,256),
tileSize: new OpenLayers.Size(256,256),
/**
* @param {str} name
@@ -25,8 +25,12 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
OpenLayers.Layer.prototype.initialize.apply(this, [name]);
this.url = url;
this.params = params;
this.tileSize = this.DEFAULT_TILE_SIZE;
},
setTileSize: function (size) {
this.tileSize = size.copyOf();
},
/**
* moveTo
* moveTo is a function called whenever the map is moved. All the moving

View File

@@ -21,6 +21,18 @@ OpenLayers.Layer.WMS.prototype =
Object.extend(this.params, this.DEFAULT_PARAMS);
},
/**
* @param
*/
clone: function (name, params) {
var mergedParams = {}
Object.extend(mergedParams, this.params);
Object.extend(mergedParams, params);
var obj = new OpenLayers.Layer.WMS(name, this.url, mergedParams);
obj.setTileSize( this.tileSize );
return obj;
},
/**
* addTile creates a tile, initializes it (via 'draw' in this case), and
* adds it to the layer div. THe tile itself is then returned so that info