You are here

leaflet_geojson_bean.api.php in Leaflet GeoJSON 7.2

Same filename and directory in other branches
  1. 7 modules/leaflet_geojson_bean/leaflet_geojson_bean.api.php

Hooks provided by the Leaflet GeoJSON Bean module.

File

modules/leaflet_geojson_bean/leaflet_geojson_bean.api.php
View source
<?php

/**
 * @file
 * Hooks provided by the Leaflet GeoJSON Bean module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Alter a leaflet geojson features array before being viewed in a bean.
 *
 * @params array $features
 *   The features to be passed to the leaflet map.
 * @params array $context
 *   An associative array containing contextual information as
 *   - array $map
 *     The leaflet map definition.
 *   - array source_info
 *     The leaflet map geojson source definition.
 *   - Bean bean
 *     The bean that renders the map based on the source.
 */
function hook_leaflet_geojson_bean_view_features_alter(array &$features, array &$context) {

  // Add bbox js.
  if (isset($context['source_info']['bbox'])) {
    leaflet_geojson_add_bbox_strategy($context['source_info']['url']);
  }
}

Functions

Namesort descending Description
hook_leaflet_geojson_bean_view_features_alter Alter a leaflet geojson features array before being viewed in a bean.