You are here

function leaflet_geojson_add_bbox_strategy in Leaflet GeoJSON 7

Same name and namespace in other branches
  1. 7.2 leaflet_geojson.module \leaflet_geojson_add_bbox_strategy()

Add a Bounding Box Strategy

Parameters

$source_info: The source info as specified in hook_leaflet_geojson_source_info().

2 calls to leaflet_geojson_add_bbox_strategy()
hook_leaflet_geojson_bean_view_features_alter in modules/leaflet_geojson_bean/leaflet_geojson_bean.api.php
Alter a leaflet geojson features array before being viewed in a bean.
leaflet_geojson_bean_leaflet_geojson_bean_view_features_alter in modules/leaflet_geojson_bean/leaflet_geojson_bean.module
Implements hook_leaflet_geojson_bean_view_features_alter().

File

./leaflet_geojson.module, line 14
API Extension for using Leaflet with GeoJSON that currently just allows to add a bbox strategy.

Code

function leaflet_geojson_add_bbox_strategy($source_info) {

  // Add bounding box javascript.
  drupal_add_js(drupal_get_path('module', 'leaflet_geojson') . '/leaflet.bbox.js', array(
    'weight' => 5,
  ));

  // Add custom settings.
  $settings = $source_info;
  drupal_add_js(array(
    'leafletBBox' => $settings,
  ), 'setting');
}