There appears to be a string length limit being imposed on the URL Field when adding a new GeoJSON source.

For me, a typical GeoServer WFS URL via a proxy might look something like:

http://52.64.107.144/?request=http://%20my.site.com.au:8888/geoserver/Ge...

This doesn't seem to fit in the provided text box.

Comments

strainyy created an issue. See original summary.

strainyy’s picture

Turns out the default textfield maxlength value is 128 characters.

I've resolved this by modifying the sites/all/modules/openlayers/src/Plugins/Source/GeoJSON/GeoJSON.php

Starting from line 34 adding a "#maxlength" value...

public function optionsForm(&$form, &$form_state) {
    $form['options']['url'] = array(
      '#title' => t('URL'),
      '#type' => 'textfield',
      '#maxlength' => '256',
      '#default_value' => $this->getOption('url'),
    );
m.stenta’s picture

Version: 7.x-3.0-beta3 » 7.x-3.x-dev

I can confirm that this is still an issue in 7.x-3.x.

256 sounds like a sane default to me.

This data is stored in a serialized array in the database, so it doesn't really have an upper limit. According to this the limit is actually closer to 2000: http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-...

Pol’s picture

Status: Active » Fixed

Thanks!

It will be included in 3.2.

  • Pol committed 7bb8a04 on 7.x-3.x
    Issue #2548463: GeoJSON URL Field Limit
    

Status: Fixed » Closed (fixed)

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