You are here

public function ControlGoogleMapType::getSettingsForm in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleMapType.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ControlGoogleMapType::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 ControlGoogleElementBase::getSettingsForm

File

modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleMapType.php, line 33

Class

ControlGoogleMapType
Provides MapType control element.

Namespace

Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature

Code

public function getSettingsForm(array $settings, array $parents) {
  $form = parent::getSettingsForm($settings, $parents);
  $settings = array_replace_recursive(self::getDefaultSettings(), $settings);
  $form['style'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Style'),
    '#options' => [
      'DEFAULT' => $this
        ->t('Default (Map size dependent)'),
      'HORIZONTAL_BAR' => $this
        ->t('Horizontal Bar'),
      'DROPDOWN_MENU' => $this
        ->t('Dropdown Menu'),
    ],
    '#default_value' => $settings['style'],
  ];
  return $form;
}