Views GeoJSON is a style plugin for Views to output location-specific data in GeoJSON, a JSON-based text format for encoding a variety of geographic data structures.

Features

  • Generates GeoJSON data feeds from content using Views.
  • Accepts data in latitude/longitude, Geofield, or WKT formats.
  • Works with OpenLayers and Leaflet modules.
  • Accepts bounding-box coordinates as an argument to filter the points returned.

Usage

  1. Create a View with a Feed display on content with locative information.
  2. Set Format for the display to GeoJSON Feed.
  3. Add View fields that include lat/lon, Geofield, or WKT data.
  4. Set those fields as GeoJSON data source.

The view output is a text document including data as GeoJSON Features, wrapped in a FeatureCollection.

See README.txt or Views GeoJSON Example Use Case for more.

Requirements

Goals

This module was born from a patch by tmcw to the OpenLayers module: Implement GeoJSON output as a standard. The goal is for Views GeoJSON to become the primary data delivery mechanism for the OpenLayers module -- see Provide GeoJSON Layers from Views (integrating with views_geojson) -- and a strong candidate for any other mapping module/system that accepts GeoJSON data.

Attribution

In addition to tmcw's aforementioned patch, a good deal of this is modeled after the Views Datasource module.

Project Information

Downloads