1

Bubble positions are wrong in case of WMS POST request. For example, a bubble is getting shifted from 31.82, -96.84(lat-long) to 31.77, -96.77. I am using openlayers 2.13.1.

The layer creation Code is:

   wms: {
      options: {
        gutter: 200,
        tileOptions: {maxGetUrlLength: 2048},
        ratio: 1,
        singleTile: true
      },..

I am using projection:"EPSG:3857". SingleTile and ratio options are not being used originally, but for experimental purpose, but irrespective of that results are same.

As per observation,

  1. GET and POST requests(using cURL) for geo-server give same images.

  2. If I don't use gutter, it gives correct result for POST (and GET also)

  3. POST url contains BBOX info, I am not sure use of that but it is different that FORM > BBOX, in case of gutter. If no gutter is used then both are equal.

  4. I just went through OpenLayers code. It seems while determining GET URL (which gets converted into POST FORM) gutter is used to adjust BBOX, it is not happening in IFrame, I guess.

  • Can you maybe explain with images what wrong poistions you are seeing? – Devdatta Tengshe Sep 26 '14 at 3:30
  • For example, a bubble is getting shifted from 31.82, -96.84(lat-long) to 31.77, -96.77 – Abhay Sep 26 '14 at 8:59
  • It's still not clear what behaviour you are experiencing. What is a Bubble? Is it shifting, or the layer underneath it? How do you know the locations? – Devdatta Tengshe Sep 26 '14 at 9:06
  • By a bubble, I mean one object, like a circle which represents some data regarding a position. I believe that, for a single tile option, entire image being in IFrame is getting wrongly positioned when gutter is specified. I know the location as we use openlayers.control.mouseposition – Abhay Sep 26 '14 at 9:19
0

I tried to debug OpenLayers code. I found that for IFrame module, gutter is not being considered while positioning in GetImage function. This consideration happens in image module. I tried to use same code in IFrame > GetImage and it works fine. Not sure this is the only way to do it but I couldn't find any other.

I have done following changes in IFrame > getImage function :

      var gutter = this.layer.gutter;

     if(gutter > 0){

        var left = 0, top = 0,
          left = gutter / this.layer.tileSize.w * 100,
          top = gutter / this.layer.tileSize.h * 100;

        iframe.style.left = -left + "%";
        iframe.style.top = -top + "%";
        iframe.style.width = (2 * left + 100) + "%";
        iframe.style.height = (2 * top + 100) + "%";
      }
      else{
        //original code for assignments to width and ht, irrespective of gutter
        iframe.style.width    = "100%";
        iframe.style.height   = "100%";
      }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.