Body: <p>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.</p>
  <p>When a user chooses this option they go to a map at /civicrm/profile/map?map=1&amp;gid=[my profile's id]&amp;reset=1.</p>
  <p>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.</p>
  <p>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.</p>
  <p>So, two questions about ways that might be possible to accomplish this:</p>
  <ol>
  <li><p>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?</p>
  </li>
  <li><p>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?</p>
  </li>
  </ol>
  <p>Thanks for your help.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-17T00:16:29.720Z
Comments.Text: 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
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-17T12:13:02.510Z
Comments.Text: 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.
Comments.UserDisplayName: Andyg8
Tags: <profile><custom-search><map>
Title: How to pre-fill a civi proximity search profile on a map
ThreadText: # How to pre-fill a civi proximity search profile on a map
  
  (Asked by: username_0 on 2021-07-16)
  
  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.
  
  **Tags:** profile, custom-search, map
  
  > **Comments:**
  > **username_1**: 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  
  > **username_0**: 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.  
  
  ---
  
  ## 0 answers
  
  