From 65e4ce3e4779c5a6cf12eb43a7c7bb1b2e470007 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sat, 21 Mar 2009 13:24:40 +0000 Subject: [PATCH] add logic in Layer.WFS to prevent sending a BBOX when a 'filter' parameter is active. This behavior is unsupportd in WFS, given an error message, so this is a way to protct people aganst that. However, users should be aware that the best way to do this probably to use Protocols and Strategies right now; this is a fix for those getting caught out by this issue until they can switch. Originla patch by Jachym, r=me (Closes #1734) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9112 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/WFS.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Layer/WFS.js b/lib/OpenLayers/Layer/WFS.js index 43640bb20a..0634787719 100644 --- a/lib/OpenLayers/Layer/WFS.js +++ b/lib/OpenLayers/Layer/WFS.js @@ -279,15 +279,27 @@ OpenLayers.Layer.WFS = OpenLayers.Class( //formulate request url string var url = this.getFullRequestString(); - var params = {BBOX: this.encodeBBOX ? tileBounds.toBBOX() - : tileBounds.toArray()}; + var params = null; + + // Cant combine "filter" and "BBOX". This is a cheap hack to help + // people out who can't migrate to the WFS protocol immediately. + var filter = this.params.filter || this.params.FILTER; + if (filter) { + params = {FILTER: filter}; + } + else { + params = {BBOX: this.encodeBBOX ? tileBounds.toBBOX() + : tileBounds.toArray()}; + } if (this.map && !this.projection.equals(this.map.getProjectionObject())) { var projectedBounds = tileBounds.clone(); projectedBounds.transform(this.map.getProjectionObject(), this.projection); - params.BBOX = this.encodeBBOX ? projectedBounds.toBBOX() - : projectedBounds.toArray(); + if (!filter){ + params.BBOX = this.encodeBBOX ? projectedBounds.toBBOX() + : projectedBounds.toArray(); + } } url += "&" + OpenLayers.Util.getParameterString(params);