You are here

public function CustomIconThemer::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

File

src/Plugin/GeofieldMapThemer/CustomIconThemer.php, line 96

Class

CustomIconThemer
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) {

  // The Custom Icon Themer plugin defines a unique icon value.
  if (!empty($map_theming_values['icon_file']['fids'])) {
    $image_style = isset($map_theming_values['image_style']) ? $map_theming_values['image_style'] : 'none';
    return $this->markerIcon
      ->getFileManagedUrl($map_theming_values['icon_file']['fids'][0], $image_style);
  }
  return NULL;
}