openlayers_proximity.png

This project is not covered by Drupal’s security advisory policy.

OpenLayers Proximity enables geographical proximity search for the OpenLayers module (6.x-2.x). The module exposes a filter to the Views module where users can specify starting point and radius of the proximity search. The starting point can be specified by simply providing the name of its location. Search radius can be given in kilometers or miles and it's easy, for external modules, to specify their own units of measurement.

Drupal 7

While this module may work for you I strongly recommend Geofield 2.x which has surpassed this module in features and is actively maintained.

Drupal 6

Views integration

OpenLayers Proximity exposes:

  • Square filter: it gives locations contained within a square derived by a simple latitude/longitude comparison. Less accurate, better performance
  • Great-circle filter: it uses the Great-circle distance formula to return locations within a circular area. More accurate, lower performance.
  • Distance sort criteria: used in combination with "Great-circle" filters it allows to sort nodes by distance from a given location.
  • Distance field: used in combination with "Great-circle" filters it shows distance from a given location.

Both filters can measure distance from a location or from another node.

Rules integration

Rules integration gives the possibility to notify nodes that something has happened "near" them. You can, for example, notify all authors that a new content has been posted close to their content.

Screenshots

The following screenshots show OpenLayers Proximity filter behavior on a grid of nodes placed 5 km from each others:

  • Starting point: "Square" not exposed filter at "< 100 km from Milan" and "Great-circle" exposed filter: here.
  • Less than 40 km from Milan: here.
  • Greater than 40 km from Milan: here.
  • Between 40 and 60 km from Milan: here.
  • Between 40 and 60 km from Milan: here.
  • Views filter settings: here.

Configuration

After enabling the module is necessary to build the proximity index table by visiting admin/build/openlayers/proximity or by running drush rebuild-proximity. This has to be done only the first time since it will index all existing nodes, the module will automatically index newly created nodes.

Related Modules

OpenLayers Geocoder: mark a location on the map by simply providing its address.

Credits:

This project has been sponsored by Nuvole.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon98 sites report using this module
  • Created by ademarco on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases