You are here

public function Location::getSettingsForm in Geolocation Field 8.2

Same name in this branch
  1. 8.2 src/Plugin/geolocation/MapCenter/Location.php \Drupal\geolocation\Plugin\geolocation\MapCenter\Location::getSettingsForm()
  2. 8.2 src/Plugin/geolocation/LocationInput/Location.php \Drupal\geolocation\Plugin\geolocation\LocationInput\Location::getSettingsForm()
Same name and namespace in other branches
  1. 8.3 src/Plugin/geolocation/MapCenter/Location.php \Drupal\geolocation\Plugin\geolocation\MapCenter\Location::getSettingsForm()

Settings form by ID and context.

Parameters

int $center_option_id: MapCenter option ID.

array $settings: The current option settings.

mixed $context: Current context.

Return value

array A form array to be integrated in whatever.

Overrides MapCenterBase::getSettingsForm

File

src/Plugin/geolocation/MapCenter/Location.php, line 54

Class

Location
Location based map center.

Namespace

Drupal\geolocation\Plugin\geolocation\MapCenter

Code

public function getSettingsForm($option_id = NULL, array $settings = [], $context = NULL) {
  if (!$this->locationManager
    ->hasDefinition($option_id)) {
    return [];
  }

  /** @var \Drupal\geolocation\LocationInterface $location_plugin */
  $location_plugin = $this->locationManager
    ->createInstance($option_id);
  $form = $location_plugin
    ->getSettingsForm($location_plugin
    ->getPluginId(), $settings, $context);
  return $form;
}