You are here

public function EntityTypeThemerUrl::getIcon in Geofield Map 8.2

Retrieve the icon for theming definition.

Parameters

array $datum: The geometry feature array definition.

\Drupal\geofield_map\Plugin\views\style\GeofieldGoogleMapViewStyle $geofieldMapView: The Geofield Map View dispaly object.

\Drupal\Core\Entity\EntityInterface $entity: The entity generating the datum.

mixed $map_theming_values: The Map themer mapping values.

Return value

mixed The icon definition.

Overrides MapThemerInterface::getIcon

1 method overrides EntityTypeThemerUrl::getIcon()
EntityTypeThemer::getIcon in src/Plugin/GeofieldMapThemer/EntityTypeThemer.php
Retrieve the icon for theming definition.

File

src/Plugin/GeofieldMapThemer/EntityTypeThemerUrl.php, line 195

Class

EntityTypeThemerUrl
Style plugin to render a View output as a Leaflet map.

Namespace

Drupal\geofield_map\Plugin\GeofieldMapThemer

Code

public function getIcon(array $datum, GeofieldGoogleMapViewStyle $geofieldMapView, EntityInterface $entity, $map_theming_values) {
  $file_uri = NULL;
  if (method_exists($entity, 'bundle')) {
    $file_uri = isset($map_theming_values[$entity
      ->bundle()]['icon_file']) && $map_theming_values[$entity
      ->bundle()]['icon_file'] != 'none' ? $map_theming_values[$entity
      ->bundle()]['icon_file'] : NULL;
  }
  return $this->markerIcon
    ->getFileSelectedUrl($file_uri);
}