You are here

public function MarkerInfoWindow::getSettingsForm in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/MarkerInfoWindow.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\MarkerInfoWindow::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/MarkerInfoWindow.php, line 35

Class

MarkerInfoWindow
Provides marker infowindow.

Namespace

Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature

Code

public function getSettingsForm(array $settings, array $parents) {
  $settings = $this
    ->getSettings($settings);
  $form['info_window_solitary'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Only allow one current open info window.'),
    '#description' => $this
      ->t('If checked, clicking a marker will close the current info window before opening a new one.'),
    '#default_value' => $settings['info_window_solitary'],
  ];
  $form['info_auto_display'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Automatically show info text.'),
    '#default_value' => $settings['info_auto_display'],
  ];
  $form['disable_auto_pan'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Disable automatic panning of map when info bubble is opened.'),
    '#default_value' => $settings['disable_auto_pan'],
  ];
  $form['max_width'] = [
    '#type' => 'number',
    '#min' => 0,
    '#title' => $this
      ->t('Max width in pixel. 0 to ignore.'),
    '#default_value' => $settings['max_width'],
  ];
  return $form;
}