You are here

function hook_leaflet_formatter_feature_alter in Leaflet 2.1.x

Same name and namespace in other branches
  1. 2.0.x leaflet.api.php \hook_leaflet_formatter_feature_alter()

Adjust the array representing a leaflet formatter feature/marker.

Parameters

array $feature: The leaflet feature. Available keys are:

  • type: Indicates the type of feature (usually one of these: point, polygon, linestring, multipolygon, multipolyline).
  • popup: This value is displayed in a popup after the user clicks on the feature.
  • Other possible keys include "lat", "lon", "points", "component", depending on feature type.

\Drupal\geofield\Plugin\Field\FieldType\GeofieldItem $item: The Geofield Item.

\Drupal\Core\Entity\ContentEntityBase $entity: The Content Entity base of the formatter.

1 invocation of hook_leaflet_formatter_feature_alter()
LeafletDefaultFormatter::viewElements in src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php
This function is called from parent::view().

File

./leaflet.api.php, line 137
API documentation for Administration menu.

Code

function hook_leaflet_formatter_feature_alter(array $feature, GeofieldItem $item, ContentEntityBase $entity) {

  // Make custom alterations to $map_settings, eventually using the $items
  // context.
}