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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user