You are here

public function OpenlayersGeolocationWidget::settingsSummary in Openlayers 8.4

Returns a short summary for the current widget settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

modules/openlayers_geolocation/src/Plugin/Field/FieldWidget/OpenlayersGeolocationWidget.php, line 74

Class

OpenlayersGeolocationWidget
Plugin implementation of an Openlayers widget.

Namespace

Drupal\openlayers\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = [];
  $map_label = \Drupal::config('openlayers.map.' . $this
    ->getSetting('map'))
    ->get('label');
  $summary[] = $this
    ->t('Openlayers map: @map', [
    '@map' => $map_label,
  ]);
  $summary[] = $this
    ->t('Map height: @height @height_unit', [
    '@height' => $this
      ->getSetting('height'),
    '@height_unit' => $this
      ->getSetting('height_unit'),
  ]);
  return $summary;
}