You are here

public function Photon::getOptionsForm in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_leaflet/src/Plugin/geolocation/Geocoder/Photon.php \Drupal\geolocation_leaflet\Plugin\geolocation\Geocoder\Photon::getOptionsForm()

Return additional options form.

Return value

array Options form.

Overrides GeocoderBase::getOptionsForm

File

modules/geolocation_leaflet/src/Plugin/geolocation/Geocoder/Photon.php, line 56

Class

Photon
Provides the Photon.

Namespace

Drupal\geolocation_leaflet\Plugin\geolocation\Geocoder

Code

public function getOptionsForm() {
  $settings = $this
    ->getSettings();
  $form = parent::getOptionsForm();
  $form['autocomplete_min_length'] = [
    '#title' => $this
      ->t('Autocomplete minimal input length'),
    '#type' => 'number',
    '#min' => 1,
    '#step' => 1,
    '#default_value' => $settings['autocomplete_min_length'],
  ];
  $form['location_priority'] = [
    '#type' => 'geolocation_input',
    '#title' => $this
      ->t('Location Priority'),
    '#default_value' => [
      'lat' => $settings['location_priority']['lat'],
      'lng' => $settings['location_priority']['lng'],
    ],
  ];
  $form['remove_duplicates'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Remove duplicates from the Photon API'),
    '#default_value' => $settings['remove_duplicates'],
    '#description' => $this
      ->t('The Photon API can generate duplicates for some locations (i.e. cities that are states for example), this option will remove them.'),
  ];
  return $form;
}