You are here

protected function GeofieldProximityFilter::defineOptions in Geofield 8

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides NumericFilter::defineOptions

File

src/Plugin/views/filter/GeofieldProximityFilter.php, line 60

Class

GeofieldProximityFilter
Field handler to filter Geofields by proximity.

Namespace

Drupal\geofield\Plugin\views\filter

Code

protected function defineOptions() {
  $options = parent::defineOptions();

  // Override some default settings from the NumericFilter.
  $options['operator'] = [
    'default' => '<=',
  ];
  $options['value'] = [
    'contains' => [
      'min' => [
        'default' => '',
      ],
      'max' => [
        'default' => '',
      ],
      'value' => [
        'default' => '',
      ],
    ],
  ];
  $options['units'] = [
    'default' => 'GEOFIELD_KILOMETERS',
  ];

  // Default Data sources Info.
  $options['source'] = [
    'default' => 'geofield_manual_origin',
  ];
  $options['source_configuration'] = [
    'default' => [
      'exposed_summary' => TRUE,
    ],
  ];
  return $options;
}