You are here

public function Leaflet::getSettingsSummary in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_leaflet/src/Plugin/geolocation/MapProvider/Leaflet.php \Drupal\geolocation_leaflet\Plugin\geolocation\MapProvider\Leaflet::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_leaflet/src/Plugin/geolocation/MapProvider/Leaflet.php, line 106

Class

Leaflet
Provides Leaflet maps.

Namespace

Drupal\geolocation_leaflet\Plugin\geolocation\MapProvider

Code

public function getSettingsSummary(array $settings) {
  $settings = array_replace_recursive(self::getDefaultSettings(), $settings);
  $summary = parent::getSettingsSummary($settings);
  $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;
}