You are here

public function GeolocationGeometryWidgetGoogleMaps::getSettings in Geolocation Field 8.3

Returns the array of settings, including defaults for missing settings.

Return value

array The array of settings.

Overrides PluginSettingsBase::getSettings

3 calls to GeolocationGeometryWidgetGoogleMaps::getSettings()
GeolocationGeometryWidgetGoogleMaps::formElement in modules/geolocation_google_maps/src/Plugin/Field/FieldWidget/GeolocationGeometryWidgetGoogleMaps.php
Returns the form for a single field widget.
GeolocationGeometryWidgetGoogleMaps::settingsForm in modules/geolocation_google_maps/src/Plugin/Field/FieldWidget/GeolocationGeometryWidgetGoogleMaps.php
Returns a form to configure settings for the widget.
GeolocationGeometryWidgetGoogleMaps::settingsSummary in modules/geolocation_google_maps/src/Plugin/Field/FieldWidget/GeolocationGeometryWidgetGoogleMaps.php
Returns a short summary for the current widget settings.

File

modules/geolocation_google_maps/src/Plugin/Field/FieldWidget/GeolocationGeometryWidgetGoogleMaps.php, line 57

Class

GeolocationGeometryWidgetGoogleMaps
Plugin implementation of 'geolocation_geometry_widget_google_maps' widget.

Namespace

Drupal\geolocation_google_maps\Plugin\Field\FieldWidget

Code

public function getSettings() {
  $settings = parent::getSettings();
  $map_settings = [];
  if (!empty($settings[$this->mapProviderSettingsFormId])) {
    $map_settings = $settings[$this->mapProviderSettingsFormId];
  }
  if (!empty($this->mapProviderId)) {
    $this->mapProvider = \Drupal::service('plugin.manager.geolocation.mapprovider')
      ->getMapProvider($this->mapProviderId);
  }
  $settings = NestedArray::mergeDeep($settings, [
    $this->mapProviderSettingsFormId => $this->mapProvider
      ->getSettings($map_settings),
  ]);
  return $settings;
}