function hook_leaflet_views_feature_alter in Leaflet 2.0.x
Same name and namespace in other branches
- 8 leaflet.api.php \hook_leaflet_views_feature_alter()
- 8 modules/leaflet_views/leaflet_views.api.php \hook_leaflet_views_feature_alter()
- 2.1.x modules/leaflet_views/leaflet_views.api.php \hook_leaflet_views_feature_alter()
Adjust the array representing a leaflet view 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.
- label: Not used at the moment.
- Other possible keys include "lat", "lon", "points", "component", depending on feature type. {@see \Drupal::service('leaflet.service')->leafletProcessGeofield()} for details.
\Drupal\views\ResultRow $row: The views result row.
\Drupal\views\Plugin\views\row\RowPluginBase $rowPlugin: (optional) The row plugin used for rendering the feature.
2 invocations of hook_leaflet_views_feature_alter()
- LeafletMap::render in modules/
leaflet_views/ src/ Plugin/ views/ style/ LeafletMap.php - Renders the View.
- LeafletMarker::renderLeafletMarkers in modules/
leaflet_views/ src/ Plugin/ views/ row/ LeafletMarker.php - Converts the given list of geo data points into a list of leaflet markers.
File
- modules/
leaflet_views/ leaflet_views.api.php, line 32 - Hook documentation for leaflet_views module.
Code
function hook_leaflet_views_feature_alter(array &$feature, ResultRow $row, RowPluginBase $rowPlugin = NULL) {
}