No new argument for Layer::redraw.

Instead, make _resolution a private property (resolution) which is set to null to make redraw call moveTo with zoomChanged set to true.
This commit is contained in:
ahocevar
2011-12-26 11:09:07 +01:00
parent ff04517232
commit d42eec9775
4 changed files with 21 additions and 15 deletions

View File

@@ -120,7 +120,8 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
*/
mergeNewParams:function(newParams) {
this.params = OpenLayers.Util.extend(this.params, newParams);
var ret = OpenLayers.Layer.prototype.redraw.call(this, true);
this.resolution = null;
var ret = this.redraw();
if(this.map != null) {
this.map.events.triggerEvent("changelayer", {
layer: this,
@@ -142,10 +143,9 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
*/
redraw: function(force) {
if (force) {
return this.mergeNewParams({"_olSalt": Math.random()});
} else {
return OpenLayers.Layer.prototype.redraw.call(this);
this.params["_olSalt"] = Math.random();
}
return OpenLayers.Layer.prototype.redraw.call(this);
},
/**