You are here

public function MapRestriction::getSettingsForm in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/MapRestriction.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\MapRestriction::getSettingsForm()

Provide a generic map settings form array.

Parameters

array $settings: The current map settings.

array $parents: Form specific optional prefix.

Return value

array A form array to be integrated in whatever.

Overrides MapFeatureBase::getSettingsForm

File

modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/MapRestriction.php, line 36

Class

MapRestriction
Provides Google Maps.

Namespace

Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature

Code

public function getSettingsForm(array $settings, array $parents) {
  $form['north'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('North'),
    '#size' => 15,
    '#default_value' => $settings['north'],
  ];
  $form['south'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('South'),
    '#size' => 15,
    '#default_value' => $settings['south'],
  ];
  $form['east'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('East'),
    '#size' => 15,
    '#default_value' => $settings['east'],
  ];
  $form['west'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('West'),
    '#size' => 15,
    '#default_value' => $settings['west'],
  ];
  $form['strict'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('strictBounds'),
    '#default_value' => $settings['strict'],
  ];
  return $form;
}