You are here

public function ControlElementBase::getSettingsForm in Geolocation Field 8.2

Same name in this branch
  1. 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ControlElementBase::getSettingsForm()
  2. 8.2 modules/geolocation_yandex/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_yandex\Plugin\geolocation\MapFeature\ControlElementBase::getSettingsForm()
  3. 8.2 modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature\ControlElementBase::getSettingsForm()
Same name and namespace in other branches
  1. 8.3 modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature\ControlElementBase::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

3 calls to ControlElementBase::getSettingsForm()
LeafletControlGeocoder::getSettingsForm in modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/LeafletControlGeocoder.php
Provide a generic map settings form array.
LeafletControlLayer::getSettingsForm in modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/LeafletControlLayer.php
Provide a generic map settings form array.
LeafletControlScale::getSettingsForm in modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/LeafletControlScale.php
Provide a generic map settings form array.
3 methods override ControlElementBase::getSettingsForm()
LeafletControlGeocoder::getSettingsForm in modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/LeafletControlGeocoder.php
Provide a generic map settings form array.
LeafletControlLayer::getSettingsForm in modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/LeafletControlLayer.php
Provide a generic map settings form array.
LeafletControlScale::getSettingsForm in modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/LeafletControlScale.php
Provide a generic map settings form array.

File

modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/ControlElementBase.php, line 27

Class

ControlElementBase
Class ControlMapFeatureBase.

Namespace

Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature

Code

public function getSettingsForm(array $settings, array $parents) {
  $form = parent::getSettingsForm($settings, $parents);
  $settings = array_replace_recursive(self::getDefaultSettings(), $settings);
  $form['position'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Position'),
    '#options' => Leaflet::getControlPositions(),
    '#default_value' => $settings['position'],
  ];
  return $form;
}