You are here

protected function GeofieldMapLegend::legendFailureElement in Geofield Map 8.2

Legend Failure element..

Parameters

\Drupal\Core\StringTranslation\TranslatableMarkup $failure_message: The View Id.

Return value

array|null The MapThemer Plugin, or null.

1 call to GeofieldMapLegend::legendFailureElement()
GeofieldMapLegend::build in src/Plugin/Block/GeofieldMapLegend.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/GeofieldMapLegend.php, line 116

Class

GeofieldMapLegend
Provides a custom Geofield Map Legend block.

Namespace

Drupal\geofield_map\Plugin\Block

Code

protected function legendFailureElement(TranslatableMarkup $failure_message = NULL) {
  if (!isset($failure_message)) {
    $failure_message = $this
      ->t("The Legend can't be rendered");
  }
  $legend_failure = $this->currentUser
    ->hasPermission('configure geofield_map') ? [
    '#type' => 'html_tag',
    '#tag' => 'div',
    '#value' => $failure_message,
    '#attributes' => [
      'class' => [
        'geofield-map-message legend-failure-message',
      ],
    ],
  ] : [];
  return $legend_failure;
}