You are here

protected function GeofieldProximityArgument::decodeUnits in Geofield 8

Get the decoded Unites.

Return value

array The decoded units array.

1 call to GeofieldProximityArgument::decodeUnits()
GeofieldProximityArgument::__construct in src/Plugin/views/argument/GeofieldProximityArgument.php
Constructs a Handler object.

File

src/Plugin/views/argument/GeofieldProximityArgument.php, line 59

Class

GeofieldProximityArgument
Argument handler for geofield proximity.

Namespace

Drupal\geofield\Plugin\views\argument

Code

protected function decodeUnits() {
  return [
    'km' => [
      'label' => $this
        ->t('Kilometers'),
      'value' => 'GEOFIELD_KILOMETERS',
    ],
    'm' => [
      'label' => $this
        ->t('Meters'),
      'value' => 'GEOFIELD_METERS',
    ],
    'mi' => [
      'label' => $this
        ->t('Miles'),
      'value' => 'GEOFIELD_MILES',
    ],
    'yd' => [
      'label' => $this
        ->t('Yards'),
      'value' => 'GEOFIELD_YARDS',
    ],
    'ft' => [
      'label' => $this
        ->t('Feet'),
      'value' => 'GEOFIELD_FEET',
    ],
    'nmi' => [
      'label' => $this
        ->T('Nautical MIles'),
      'value' => 'GEOFIELD_NAUTICAL_MILES',
    ],
  ];
}