2

We're using Google for geocoding, and when we use Civi's proximity search on a profile we get the very cool option in the search results to view the contacts on a map.

When a user chooses this option they go to a map at /civicrm/profile/map?map=1&gid=[my profile's id]&reset=1.

This map is nicely zoomed to the radius set for the proximity search. So if we search for contacts within 200km of a city, the map centres on the city and shows the surrounding 200km.

We want the profile to initially show all the results for a region, before the user clicks the search button. Then the user can then narrow down the search if they want. We don't want them to have to start by entering a distance.

So, two questions about ways that might be possible to accomplish this:

  1. Is there any way we can construct a url so that when the user goes to the page the map is already set to a specific location and to a zoom level of our choice, and showing all the relevant contacts?

  2. Or, another, related question which would also solve this for us is: Is there a way to show a profile with a pre-filled proximity search radius, and so the profile page loads in such a way that it is initially showing all the results inside that radius?

Thanks for your help.

2
  • maybe update your answer to clarify if you would accept Drupal (ie Views and Leaflet) solutions or if this has to be civicrm profile solution
    – petednz - fuzion
    Jul 17 at 0:16
  • Yes good question. I'd very much prefer to discover a Civicrm profile solution, since we already have that working beautifully, but just without pre-fill, and without map pre-configuration. If necessary though, we could use Drupal Views. We don't have Leaflet installed - yet.
    – Andyg8
    Jul 17 at 12:13

Your Answer

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

Browse other questions tagged or ask your own question.