Commit a 'changeParams' method, along with test and example, to show how it would be possible to use WMS-T with changeParams. ChangeParams sets the new params, then recalls initTiles with the new params set.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@843 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-06-30 23:59:42 +00:00
parent c958f9f88a
commit 2117aa0539
4 changed files with 78 additions and 0 deletions
+10
View File
@@ -309,6 +309,16 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
addTile:function(bounds,position) {
// Should be implemented by subclasses
},
/**
* changeParams is designed to allow you to change the
* parameters of a layer after it's created.
* @param {Object} params Hash of new params to use
*/
changeParams:function(params) {
this.params = Object.extend(this.params, OpenLayers.Util.upperCaseObject(params));
this._initTiles();
},
/**
* @returns Degrees per Pixel
+11
View File
@@ -92,6 +92,17 @@ OpenLayers.Layer.WMS.Untiled.prototype =
tile.draw();
}
},
/**
* changeParams is designed to allow you to change the
* parameters of a layer after it's created.
* @param {Object} params Hash of new params to use
*/
changeParams:function(params) {
this.params = Object.extend(this.params, OpenLayers.Util.upperCaseObject(params));
this._initTiles();
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Layer.WMS.Untiled"
});