You are here

public function BBoxQuery::buildOptionsForm in Views GeoJSON 8

Provide the default form for setting options.

Overrides QueryParameter::buildOptionsForm

File

src/Plugin/views/argument_default/BBoxQuery.php, line 25

Class

BBoxQuery
The BBOX query string argument default handler.

Namespace

Drupal\views_geojson\Plugin\views\argument_default

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['info'] = [
    '#markup' => '<p class="description">Attempt to pull bounding box info
      directly from the query string, bypassing Drupal\'s normal argument
      handling. If the argument does not exist, all values will be shown.</p>',
  ];
  $form['arg_id'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Query argument ID'),
    '#size' => 60,
    '#maxlength' => 64,
    '#default_value' => $this->options['arg_id'] ? $this->options['arg_id'] : $this
      ->t('bbox'),
    '#description' => $this
      ->t('The ID of the query argument.<br />For OpenLayers use <em>bbox</em>, (as in "<em>?bbox=left,bottom,right,top</em>".)'),
  ];
}