You are here

public function GoogleMapsProviderBase::getSettingsSummary in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_google_maps/src/GoogleMapsProviderBase.php \Drupal\geolocation_google_maps\GoogleMapsProviderBase::getSettingsSummary()

Provide a summary array to use in field formatters.

Parameters

array $settings: The current map settings.

Return value

array An array to use as field formatter summary.

Overrides MapProviderBase::getSettingsSummary

File

modules/geolocation_google_maps/src/GoogleMapsProviderBase.php, line 181

Class

GoogleMapsProviderBase
Class GoogleMapsProviderBase.

Namespace

Drupal\geolocation_google_maps

Code

public function getSettingsSummary(array $settings) {
  $types = $this
    ->getMapTypes();
  $settings = array_replace_recursive(self::getDefaultSettings(), $settings);
  $summary = parent::getSettingsSummary($settings);
  $summary[] = $this
    ->t('Map Type: @type', [
    '@type' => $types[$settings['type']],
  ]);
  $summary[] = $this
    ->t('Zoom level: @zoom', [
    '@zoom' => $settings['zoom'],
  ]);
  $summary[] = $this
    ->t('Height: @height', [
    '@height' => $settings['height'],
  ]);
  $summary[] = $this
    ->t('Width: @width', [
    '@width' => $settings['width'],
  ]);
  return $summary;
}