Allow for users to determine whether the bounding box should be encoded or

not on WMS and WFS layers. This change, by default, makes us compliant
with the WMS spec again.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@4038 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-08-24 23:50:43 +00:00
parent 42e4f72a9f
commit c8afa7222b
8 changed files with 112 additions and 6 deletions

View File

@@ -99,6 +99,16 @@ OpenLayers.Bounds = OpenLayers.Class({
+ " right-top=(" + this.right + "," + this.top + ")" );
},
/**
* APIMethod: toArray
*
* Return:
* {Array} array of left, bottom, right, top
*/
toArray: function() {
return [this.left, this.bottom, this.right, this.top];
},
/**
* APIMethod: toBBOX
*

View File

@@ -51,6 +51,13 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
* {Boolean} Should be calculated automatically.
*/
vectorMode: true,
/**
* APIProperty: encodeBBOX
* {Boolean} Should the BBOX commas be encoded? The WMS spec says 'no',
* but some services want it that way. Default false.
*/
encodeBBOX: false,
/**
* Constructor: OpenLayers.Layer.WFS
@@ -196,7 +203,8 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
//formulate request url string
var url = this.getFullRequestString();
var params = { BBOX:tileBounds.toBBOX() };
var params = {BBOX: this.encodeBBOX ? tileBounds.toBBOX()
: tileBounds.toArray()};
url += "&" + OpenLayers.Util.getParameterString(params);
if (!this.tile) {

View File

@@ -43,6 +43,13 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
* {Boolean} Default is true for WMS layer
*/
isBaseLayer: true,
/**
* APIProperty: encodeBBOX
* {Boolean} Should the BBOX commas be encoded? The WMS spec says 'no',
* but some services want it that way. Default false.
*/
encodeBBOX: false,
/**
* Constructor: OpenLayers.Layer.WMS
@@ -146,7 +153,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
var imageSize = this.getImageSize();
return this.getFullRequestString(
{BBOX:bounds.toBBOX(),
{BBOX: this.encodeBBOX ? bounds.toBBOX() : bounds.toArray(),
WIDTH:imageSize.w,
HEIGHT:imageSize.h});
},