You are here

public function GoogleMapsDisplayTrait::getGoogleMapsSettingsSummary in Geolocation Field 8

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.

2 calls to GoogleMapsDisplayTrait::getGoogleMapsSettingsSummary()
GeolocationGooglegeocoderWidget::settingsSummary in src/Plugin/Field/FieldWidget/GeolocationGooglegeocoderWidget.php
Returns a short summary for the current widget settings.
GeolocationGoogleMapFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php
Returns a short summary for the current formatter settings.

File

src/GoogleMapsDisplayTrait.php, line 209

Class

GoogleMapsDisplayTrait
Class GoogleMapsDisplayTrait.

Namespace

Drupal\geolocation

Code

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