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.


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.


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.


This project has been sponsored by Nuvole.

Project Information