Has anyone used a proximity filter or sort in Drupal Views based upon a contact's geocoded address? I think it would be doable with the GeoPHP module and a special handler, but I don't know if it has been done.
2 Answers
We've done this with OpenLayers https://www.drupal.org/project/openlayers and Openlayers Proximity https://www.drupal.org/project/openlayers_proximity
I wrote a blog article which in part describes how to create a OpenLayers map and Openlayers Map Views overlay with CiviCRM Event location plotted on a map. This should give you enough pointers to design your own Openlayers Map, View and get you started: http://jackrabbithanna.com/articles/drupalcivicrm-integration
This article does not include the Proximiy functionality you are looking for, but just install Openlayers Proximity and the filtering will be made available in the Views UI
I've just set up a proximity search using this new-ish module: https://www.drupal.org/project/civicrm_contact_distance_search
About to see if I can use something like Leafet to add a map as well.
-
hmm - shame we didn't spot that. just did a bunch of work to do a drupal side 'search by proximity and then save as Smart Group' work.– petednz - fuzion ♦Feb 12, 2017 at 19:03
-
I only came across it by chance myself. I was looking at the Openlayers-based approach which looked like sledgehammer to crack nut. Would be great to get something like this re-written as an extension.– GrahamFeb 14, 2017 at 9:44