You are here

public function EntityTypeThemer::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 EntityTypeThemerUrl::getIcon

File

src/Plugin/GeofieldMapThemer/EntityTypeThemer.php, line 136

Class

EntityTypeThemer
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) {
  $fid = NULL;
  $image_style = isset($map_theming_values[$entity
    ->bundle()]['image_style']) ? $map_theming_values[$entity
    ->bundle()]['image_style'] : 'none';
  if (method_exists($entity, 'bundle')) {
    $fid = isset($map_theming_values[$entity
      ->bundle()]['icon_file']) ? $map_theming_values[$entity
      ->bundle()]['icon_file']['fids'] : NULL;
  }
  return $this->markerIcon
    ->getFileManagedUrl($fid, $image_style);
}