You are here

public function MarkerIconService::getLegendIconFromFileUri in Geofield Map 8.2

Generate Legend Icon from selected File Uri.

Parameters

string $file_uri: The file uri to save.

int $icon_width: The icon width.

Return value

array The icon view render array..

File

src/Services/MarkerIconService.php, line 551

Class

MarkerIconService
Provides an Icon Managed File Service.

Namespace

Drupal\geofield_map\Services

Code

public function getLegendIconFromFileUri($file_uri, $icon_width = NULL) {
  $icon_element = [
    '#theme' => 'image',
    '#uri' => file_create_url($file_uri),
    '#attributes' => [
      'width' => $icon_width,
    ],
  ];
  return $icon_element;
}