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
This commit is contained in:
@@ -279,15 +279,27 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
|
|||||||
//formulate request url string
|
//formulate request url string
|
||||||
var url = this.getFullRequestString();
|
var url = this.getFullRequestString();
|
||||||
|
|
||||||
var params = {BBOX: this.encodeBBOX ? tileBounds.toBBOX()
|
var params = null;
|
||||||
: tileBounds.toArray()};
|
|
||||||
|
// 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())) {
|
if (this.map && !this.projection.equals(this.map.getProjectionObject())) {
|
||||||
var projectedBounds = tileBounds.clone();
|
var projectedBounds = tileBounds.clone();
|
||||||
projectedBounds.transform(this.map.getProjectionObject(),
|
projectedBounds.transform(this.map.getProjectionObject(),
|
||||||
this.projection);
|
this.projection);
|
||||||
params.BBOX = this.encodeBBOX ? projectedBounds.toBBOX()
|
if (!filter){
|
||||||
: projectedBounds.toArray();
|
params.BBOX = this.encodeBBOX ? projectedBounds.toBBOX()
|
||||||
|
: projectedBounds.toArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
url += "&" + OpenLayers.Util.getParameterString(params);
|
url += "&" + OpenLayers.Util.getParameterString(params);
|
||||||
|
|||||||
Reference in New Issue
Block a user