You are here

function views_geojson_views_data in Views GeoJSON 8

Same name and namespace in other branches
  1. 6 views/views_geojson.views.inc \views_geojson_views_data()
  2. 7 views/views_geojson.views.inc \views_geojson_views_data()

Implements hook_views_data().

Adds bounding box contextual filter.

File

./views_geojson.views.inc, line 15

Code

function views_geojson_views_data() {
  $data = [];
  $data['views']['views_geojson_bbox_argument'] = [
    'group' => t('Views GeoJSON'),
    'real field' => 'bbox_argument',
    'title' => t('Bounding box'),
    'help' => t('Limit the results to those within a geospatial bounding box. Can be used in conjunction with Leaflet.'),
    'argument' => [
      'id' => 'views_geojson_bbox_argument',
      'label' => t('Bounding box'),
      'empty field name' => '- No value -',
    ],
  ];
  return $data;
}