I have a content type and it has a geolocation field which stores a lat long . If I create one node with some lat / long info, I need to look up / show a view of other nodes that have lat long information which is in the proximity of the former's lat long info. Any idea how to do this?

  • I've used the Location Module (www.drupal.org/project/location) on Drupal 6 and it allowed for proximity based Views. Was that the module that gave no joy? If not you may want to look into it. – Jimajamma Jul 1 '13 at 12:18
  • For future reference, the Location module is pretty rubbish in Drupal 7 - especially when you stack it against other geocoding options. – Chapabu Jul 2 '13 at 8:49

Geolocation Proximity seems to be exactly a solution for you. You will need to keep location data using Geolocation Field to benefit from it.

Current features are:

  • Views filter that can be used to filter entities (nodes, users, etc.) based on distance from a certain point (defined as lat/lng point). The input widget is very basic at the moment. Patches welcome...
  • Views field to display the calculated distance between the entity and a reference point (can be synced with filters' lat/lng values).
  • User-friendly input widget for exposed filters using Google's reverse geocoder

Big lacking features are:

  • HTML 5 Geolocation input
  • proximity SQL look ups

It's competitor is Get Locations module. It's a suite that uses Google Maps API. One of it's functions is:

Getlocations Search which uses Google Geocoding on entered search terms and shows nearby locations. The search form is fully configurable with options for setting the Search distance, Distance units, Number of locations to show and Restrict the search to a content type.

Emphasis mine.

Last but not least, you can use Computed Field. It can be calculated on access, so it is perfectly possible to make PHP computed field displaying "distance from X" where X is defined on the fly. You will need to write computation in PHP, but you will not be tied to any particular metric.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.