You are here

public function FixedCoordinates::getSettingsForm in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/geolocation/Location/FixedCoordinates.php \Drupal\geolocation\Plugin\geolocation\Location\FixedCoordinates::getSettingsForm()

Settings form by ID and context.

Parameters

int $location_option_id: Location option ID.

array $settings: The current option settings.

mixed $context: Current context.

Return value

array A form array to be integrated in whatever.

Overrides LocationBase::getSettingsForm

File

src/Plugin/geolocation/Location/FixedCoordinates.php, line 34

Class

FixedCoordinates
Fixed coordinates map center.

Namespace

Drupal\geolocation\Plugin\geolocation\Location

Code

public function getSettingsForm($option_id = NULL, array $settings = [], $context = NULL) {
  $settings = $this
    ->getSettings($settings);
  $form = [
    'latitude' => [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Latitude'),
      '#default_value' => $settings['latitude'],
      '#size' => 60,
      '#maxlength' => 128,
    ],
    'longitude' => [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Longitude'),
      '#default_value' => $settings['longitude'],
      '#size' => 60,
      '#maxlength' => 128,
    ],
  ];
  return $form;
}