From 5d64ebdf94e1a4d3c2d8cfcab4083639af3c2bc4 Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 9 Aug 2006 06:24:28 +0000 Subject: [PATCH] updates so WFS *should* work with new tiling algorithm git-svn-id: http://svn.openlayers.org/trunk/openlayers@1154 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/WFS.js | 6 ++---- lib/OpenLayers/Tile/WFS.js | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/OpenLayers/Layer/WFS.js b/lib/OpenLayers/Layer/WFS.js index 171926d62c..7a0ae968b4 100644 --- a/lib/OpenLayers/Layer/WFS.js +++ b/lib/OpenLayers/Layer/WFS.js @@ -134,14 +134,12 @@ OpenLayers.Layer.WFS.prototype = var urls = new Array(); //add standard URL - urls.push( this.getFullRequestString( { BBOX:bounds.toBBOX() }) ); + urls.push( this.getFullRequestString() ); if (this.urls != null) { // if there are more urls, add them. for(var i=0; i < this.urls.length; i++) { - var newUrl = this.getFullRequestString( { BBOX:bounds.toBBOX() }, - this.urls[i] ); - urls.push(newUrl); + urls.push( this.getFullRequestString(null, this.urls[i]) ); } } diff --git a/lib/OpenLayers/Tile/WFS.js b/lib/OpenLayers/Tile/WFS.js index e4ef7205eb..222d30be78 100644 --- a/lib/OpenLayers/Tile/WFS.js +++ b/lib/OpenLayers/Tile/WFS.js @@ -39,13 +39,20 @@ OpenLayers.Tile.WFS.prototype = * */ destroy: function() { - for(var i=0; i < this.features.length; i++) { - this.features[i].destroy(); - } + this.clear(); this.urls = null; OpenLayers.Tile.prototype.destroy.apply(this, arguments); }, + /** Clear the tile of any bounds/position-related data so that it can + * be reused in a new location. + */ + clear: function() { + for(var i=0; i < this.features.length; i++) { + this.features[i].destroy(); + } + }, + /** */ draw:function() { @@ -57,6 +64,9 @@ OpenLayers.Tile.WFS.prototype = * @param {OpenLayers.pixel} position */ moveTo: function (bounds, position) { + + this.loaded = false; + OpenLayers.Tile.prototype.moveTo.apply(this, arguments); }, @@ -80,8 +90,11 @@ OpenLayers.Tile.WFS.prototype = this.loaded = true; for(var i=0; i < this.urls.length; i++) { - OpenLayers.loadURL(this.urls[i], null, this, - success, failure); + var params ={ BBOX:bounds.toBBOX() }; + var url = this.urls[i] + + OpenLayers.Util.getParameterString(params); + OpenLayers.loadURL(url, null, this, + success, failure); } } }