OpenLayers OpenLayers

Ticket #762 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

URLEncoding in BBOX Parameter

Reported by: euzuro Assigned to: crschmidt
Priority: minor Milestone: 2.5 Release
Component: Layer Version: 2.4
Keywords: Cc:
State:

Description (Last modified by euzuro)

From a thread to the users@ list by Nick W:

I'm getting a strange effect if I use a Mercator projection WMS server with a
bounding box which can take negative values in 2.4rc3 or the SVN version,
which I didn't get in 2.2.

Looking at the URL constructed to get the tiles, it appears to be URL-encoding
the commas which messes up the bbox.

i.e. the URL I get for the tiles in 2.4-rc3 is something like:

http://www.free-map.org.uk/cgi-bin/render?BBOX=-80000%2C6595000%2C-75000%2C6600000
&WIDTH=500&HEIGHT=500

rather than in 2.2:

http://www.free-map.org.uk/cgi-bin/render?BBOX=-80000,6595000,-75000,6600000
&WIDTH=500&HEIGHT=500

As suggested by Bart, this is related to #491

Attachments

encodeBBOX.patch (6.3 kB) - added by crschmidt on 08/23/07 09:11:43.
encodeBBOX.2.patch (9.7 kB) - added by crschmidt on 08/23/07 09:25:53.
encodeBBOX.3.patch (9.7 kB) - added by crschmidt on 08/23/07 13:53:18.
fix ie test failure

Change History

06/13/07 17:30:53 changed by euzuro

  • description changed.
  • summary changed from URLEncoding in Layer Parameters to URLEncoding in BBOX Parameter.

07/15/07 09:39:15 changed by crschmidt

A simple patch for this would look like:

Index: Layer/WMS.js
===================================================================
--- Layer/WMS.js        (revision 3727)
+++ Layer/WMS.js        (working copy)
@@ -148,7 +148,7 @@
         
         var imageSize = this.getImageSize(); 
         return this.getFullRequestString(
-                     {BBOX:bounds.toBBOX(),
+                     {BBOX:bounds.toBBOX().split(","),
                       WIDTH:imageSize.w,
                       HEIGHT:imageSize.h});
     },

But rather than just patch it, we should probably:

  • Make it an option on the layer
  • Figure out which other layers are affected by this, if any. The WFS layer comes to mind.

08/03/07 11:31:59 changed by crschmidt

  • owner set to crschmidt.
  • status changed from new to assigned.

08/23/07 09:11:43 changed by crschmidt

  • attachment encodeBBOX.patch added.

08/23/07 09:25:53 changed by crschmidt

  • attachment encodeBBOX.2.patch added.

08/23/07 09:27:40 changed by crschmidt

  • keywords set to review.

* Add toArray function on BBOX * Add encodeBBOX APIProperty to WFS, WMS (defaulting to false, to match the spec) * Add tests for encodeBBOX on WMS, WFS (with and without) * Add tests for toArray on BBOX * Update existing tests which depend on URL string equivilance.

08/23/07 09:28:41 changed by crschmidt

  • Add toArray function on BBOX
  • Add encodeBBOX APIProperty to WFS, WMS (defaulting to false, to match the spec)
  • Add tests for encodeBBOX on WMS, WFS (with and without)
  • Add tests for toArray on BBOX
  • Update existing tests which depend on URL string equivilance.

(better formatting)

08/23/07 13:53:18 changed by crschmidt

  • attachment encodeBBOX.3.patch added.

fix ie test failure

08/23/07 14:05:15 changed by tschaub

Since the WMS spec says comma delimited encoded components for layers, styles, and bbox, shouldn't we make this our default?

08/24/07 19:47:59 changed by tschaub

  • keywords changed from review to commit.

Tests pass in IE and FF. Please commit.

$10K question: if MS makes the browser and the OS, why do tests run 5x faster in FF?

08/24/07 19:55:14 changed by crschmidt

  • status changed from assigned to closed.
  • resolution set to fixed.

08/27/07 15:39:19 changed by tschaub

  • keywords deleted.