[OpenLayers-Commits] r3584 - in trunk/openlayers: lib/OpenLayers/Layer lib/OpenLayers/Layer/MapServer lib/OpenLayers/Layer/WMS tests/Layer
commits at openlayers.org
commits at openlayers.org
Thu Jul 5 10:24:16 EDT 2007
Author: euzuro
Date: 2007-07-05 10:24:15 -0400 (Thu, 05 Jul 2007)
New Revision: 3584
Modified:
trunk/openlayers/lib/OpenLayers/Layer/Grid.js
trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js
trunk/openlayers/lib/OpenLayers/Layer/MapServer/Untiled.js
trunk/openlayers/lib/OpenLayers/Layer/WFS.js
trunk/openlayers/lib/OpenLayers/Layer/WMS/Untiled.js
trunk/openlayers/tests/Layer/test_HTTPRequest.html
Log:
fix for #800 - the mergeNewParams function is now simplified. the only time it need be overridden now is in WMS, which mandates that all parameters should be uppercased. thanks for the review and the added test, tim.
Modified: trunk/openlayers/lib/OpenLayers/Layer/Grid.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/Grid.js 2007-07-05 14:08:15 UTC (rev 3583)
+++ trunk/openlayers/lib/OpenLayers/Layer/Grid.js 2007-07-05 14:24:15 UTC (rev 3584)
@@ -395,23 +395,6 @@
addTile:function(bounds, position) {
// Should be implemented by subclasses
},
-
- /**
- * APIMethod: mergeNewParams
- * Once params have been changed, we will need to re-init our tiles
- *
- * Parameters:
- * newParams - {Object} Hashtable of new params to use
- */
- mergeNewParams:function(newArguments) {
- OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,
- [newArguments]);
-
- if (this.map != null) {
- this._initTiles();
- }
- },
-
/**
* Method: shiftRow
Modified: trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js 2007-07-05 14:08:15 UTC (rev 3583)
+++ trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js 2007-07-05 14:24:15 UTC (rev 3584)
@@ -115,6 +115,7 @@
*/
mergeNewParams:function(newParams) {
this.params = OpenLayers.Util.extend(this.params, newParams);
+ this.redraw();
},
/**
Modified: trunk/openlayers/lib/OpenLayers/Layer/MapServer/Untiled.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/MapServer/Untiled.js 2007-07-05 14:08:15 UTC (rev 3583)
+++ trunk/openlayers/lib/OpenLayers/Layer/MapServer/Untiled.js 2007-07-05 14:24:15 UTC (rev 3584)
@@ -243,21 +243,8 @@
OpenLayers.Layer.HTTPRequest.prototype.setUrl.apply(this, arguments);
this.redraw();
},
-
+
/**
- * APIMethod: mergeNewParams
- * Once HTTPRequest has updated new params, reload the image div
- *
- * Parameters:
- * newParams - {Object}
- */
- mergeNewParams:function(newParams) {
- OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,
- [newParams]);
- this.redraw();
- },
-
- /**
* APIMethod: getFullRequestString
* combine the layer's url with its params and these newParams.
*
Modified: trunk/openlayers/lib/OpenLayers/Layer/WFS.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/WFS.js 2007-07-05 14:08:15 UTC (rev 3583)
+++ trunk/openlayers/lib/OpenLayers/Layer/WFS.js 2007-07-05 14:24:15 UTC (rev 3584)
@@ -248,8 +248,6 @@
var newArguments = [upperParams];
OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,
newArguments);
- //redraw
- this.moveTo(null, true);
},
/**
Modified: trunk/openlayers/lib/OpenLayers/Layer/WMS/Untiled.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/WMS/Untiled.js 2007-07-05 14:08:15 UTC (rev 3583)
+++ trunk/openlayers/lib/OpenLayers/Layer/WMS/Untiled.js 2007-07-05 14:24:15 UTC (rev 3584)
@@ -259,21 +259,6 @@
OpenLayers.Layer.HTTPRequest.prototype.setUrl.apply(this, arguments);
this.redraw();
},
-
- /**
- * APIMethod: mergeNewParams
- * Once HTTPRequest has updated new params, reload the image div
- *
- * Parameters:
- * newParams - {Object}
- */
- mergeNewParams:function(newParams) {
- var upperParams = OpenLayers.Util.upperCaseObject(newParams);
- var newArguments = [upperParams];
- OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,
- newArguments);
- this.redraw();
- },
/**
* APIMethod: getFullRequestString
Modified: trunk/openlayers/tests/Layer/test_HTTPRequest.html
===================================================================
--- trunk/openlayers/tests/Layer/test_HTTPRequest.html 2007-07-05 14:08:15 UTC (rev 3583)
+++ trunk/openlayers/tests/Layer/test_HTTPRequest.html 2007-07-05 14:24:15 UTC (rev 3584)
@@ -65,7 +65,7 @@
}
function test_05_Layer_HTTPRequest_mergeNewParams (t) {
- t.plan( 3 );
+ t.plan( 4 );
layer = new OpenLayers.Layer.HTTPRequest(name, url, params, options);
@@ -80,6 +80,11 @@
newParams.chickpeas = 151;
t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() makes clean copy of hash");
+
+ layer.redraw = function() {
+ t.ok(true, "layer.mergeNewParams calls layer.redraw");
+ }
+ layer.mergeNewParams();
}
More information about the Commits
mailing list