Hi I'm wondering if it's possible to increase the length of the base URL field for the layer settings. I often run into trouble because of truncated URLs.

#1 1512486-01.openlayers.wmsurllength.patch1.53 KBekes
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]


new1.53 KB
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

The field is stored serialized in the data text field of the {openlayers_layers} table, so there is plenty of space, and no constraint other than the form field and validation. 2083 characters seems a common maximum for URLs, although though they could be longer. So suggest patch attached (or even larger?).

Status:Active» Needs review

Version:7.x-2.0-beta1» 7.x-2.x-dev

Thanks @ekes ! Patch committed ;-)

I had to do it manually because your patch was containing stuff from #1491314: Redundant indexes on Styles and Layers tables.

Status:Needs review» Fixed

Hi, thanks. Can I update to the latest dev or do I have to patch?

Status:Fixed» Needs review

Hi, I tried the latest dev (2012-Aug-28) but there is a new problem. The WMS Base URL field remains empty now. I've created a new issue for that (http://drupal.org/node/1761768) since it might be an other problem.

Status:Needs review» Fixed


Can you check again with the dev version ?


Status:Fixed» Needs work

Hi, thanks for the fast reply. In the latest dev version the WMS Base URL field contains now the URL. So the issue with the empty field is solved. But the problem of this thread remains since I still can't insert URLs with more than 128 characters.

Status:Needs work» Fixed

Hello @de_chris,

I just tested and it works pretty good, the base layer is not trimmed or altered.

Steps I did:

  1. Create a new WMS layer
  2. Copy paste a string with 160 char for the Base URL
  3. Save
  4. Edit the newly created layer.

Hello @Pol,
I also tested it with a new layer and it works. The restrictions only remain when editing or cloning existing layers. Thanks a lot.

Status:Fixed» Needs work

Weird, I'll fix that tonight. Thanks for the report.

Status:Needs work» Fixed

Hello @de_chris,

I wasn't able to reproduce the problem even by editing the layer.

Hi my steps to reproduce:
edited an existing layer created with an older OL-Version; replace existing url by:tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt; copied the sting in the field and got:tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
but thats not a great problem since I can now create new layers with more than 128 long urls.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Thanks. I used the same fix for a new XYZ Layer. :)

        '#type' => 'textfield',
        '#title' => t('Base URL (template)'),
        '#maxlength' => 2083,
        '#default_value' => isset($this->data['url']) ?
          $this->data['url'] : '',
        '#description' => t('This is the base URL template for the XYZ layer.  It should be something similar to <em>http://example.com/tiles/1.0.0/layer_name/${z}/${x}/${y}.png</em>.'),

in openlayers_layer_type_xyz.inc

Thanks, I did it on 7.x-2.x too.