Location Search

Learn how to implement the location search functionality in MapsPro.

Getting Started

Address-based searches can be added to your existing search and filter forms where you are using the JReviews Advanced Search/Filtering Joomla Modules and WordPress widgets.

In the Add-on Configuration → Basic Setup make sure:

  • Proximity search is enabled.
  • Advanced search address field is filled out with the field to which you want to attach the location search functionality. Typically this would be the existing address custom field (e.g. jr_address).
  • Address autocomplete is optional. When enabled users will see suggestions when typing an address in the above field.

Since the location search functionality attaches itself to the specified address field mentioned above, this field needs to be present in the search form.

JReviews comes with a ready-to-go search module/widget suffix _map that includes the jr_address custom field and the distance dropdown. you can add the theme suffix to the Advanced Search Joomla Module and WordPress widget.

For more control, you can use the module/widget THEME CUSTOMIZATION section. Enable the Module Theme, then add the HTML markup for your search form.

The following markup:

<div class="fwd-flex fwd-space-x-4">

  <div class="jrFieldDiv">
     {jr_address}
  </div>

  <div class="jrFieldDiv">
    {radius options=5,10,25,50,100} 
  </div>

  <div class="jrFieldDiv">
     <button class="jr-search jrButton">
        <span class="jrIconSearch"></span><span>Search</span>
     </button>
  </div>

</div>

Location advanced search
Location advanced search

To include the category select, or keywords input, you can use their corresponding tags:

<div class="jrFieldDiv">
   {category}
</div>

<div class="jrFieldDiv">
   {keywords}
</div>

Learn more about the Advanced Search Module and its customization options.

Advanced Filtering Form

You can also implement location searches when using advanced filtering. Similar to advanced search, you'll need to add a filter to the module theme for the specified address field (e.g. jr_address).

[filter 
	label="Proximity search" 
	name="jr_address" 
	placeholder="City, address, postal code" 
	radius_min="10" 
	radius_max="100" 
	radius_step="5" 
	radius_default="30"
	width="300"
]

As shown above, there are specific location search attributes that can be used with the address filter:

  • radius_min and radius_max are used to set the bounds for the distance slider
  • radius_step will be used to include increment options for the distance slider
  • radius_default sets the default option for the distance slider

Location advanced filtering
Location advanced filtering

Learn more about the Advanced Filtering Module and it's customization options.