Distance Controls

Agile Store Locator has three distance control options available for users and customers:

  1. Slider – For those who prefer a more interactive experience. This option enables distance control from a slider which allows you to increase or decrease the radius miles from the chosen location.
  1. Dropdown Control – Allows distance to directly be controlled from a dropdown menu. Users can quickly move to a specific distance by choosing a number from the dropdown menu.
  1. Boundary Box –  The Boundary Box option enables users to view a list of stores within a certain area. Therefore, only showing the store list within the confines of the selected area.

These three distance control options can be selected from the “ASL Settings” page to be implemented on the store list

Distance Control Options
Distance Control Options

1- Setting the Radius Value for the Distance Range Slider #

Agile Store Locator features an option to fix your radius to any numeric value in kilometers or miles. Also, the stores within the range of the radius will appear, and through the slider, users can reduce the distance filter down to 0.1 Miles. Furthermore, the default value of the radius distance is the distance from the user’s current location to the farthest store.

For example,  if the store locator is showing 3 stores A, B, and C, and each store is at the following distance from the user’s location:

  1. Store A – 5 miles
  2. Store B – 8 miles
  3. Store C – 12 miles

In this case, the longest distance is 12 miles which will be the default value of the distance slider and the radius. A user can easily change this by applying a fixed value to it by using the below shortcode

[ASL_STORELOCATOR fixed_radius="10"]

 In the above shortcode, the value for the fixed radius is 10 (miles or kilometers). Therefore, all the stores within a 10 mile/km radius will be visible.

2- Changing Distance Values for the Dropdown Distance Menu #

Users also have the flexibility to choose how many values appear in the “Dropdown” distance control. In addition, the default value can also be set for the dropdown menu.

In “ASL Settings”, under “Search Dropdown Options” users can set what values they want to appear in the menu. Furthermore, the default value is selected by adding a “*” before the default value.

For example, if a user typed  [10, 20, *30, 40, 50] in the “Search Dropdown Options” as shown below.

Dropdown Menu Values
Dropdown Menu Values

The resulting map will look like the below image, with all the values that were added in the field and 30 as the default value.

Values Added to the Map
Values Added to the Map

3- How to Define a Different Radius for Each Store #

Users can assign a separate store radius base for each store which will display each store on the map if they fall within a search range. For example, let’s suppose you have three stores A, B, and C that you want to assign a radius of 5 KM, 7KM and, 9KM respectively. Therefore, if a searched store is within range with any of these stores, they will appear on the store listing. Furthermore, to implement this feature, please follow the below steps:

  1.  Go to “ASL Settings” and head over to the “Manage Additional Fields” section
Custom Field Manager
Custom Field Manager
  1. Create a custom field label called “Radius” with the control name “radius” in the custom field manager
  2. Add the store radius values for each store, this can be done through the CSV file import or through the form
  3. Once the store radius has been assigned, use the below shortcode to enable this functionality
[ASL_STORELOCATOR store_radius="1"]

How to Disable Distance Control? #

If you don’t want to filter out the results based on the distance, please simply disable the distance control from the ASL Settings, and your stores will not be filtered based on the distance.

blank

Agile Store Locator utilizes the displacement approach to calculate distances for the list of stores displayed. Here’s an overview of how the distance is calculated:

  1. Displacement vs. Distance: Agile Store Locator calculates the distance as displacement rather than traditional distance. It’s important to note that this displacement calculation differs from the walking or driving distance provided by services like Google Maps, which rely on complex algorithms from the Google Matrix API.
    distance-and-displacement
  2. Limitations: As a result of using displacement for distance calculation, it’s not feasible to directly compare the distance shown in the store list with the distances provided by Google Maps. The calculations are tailored to the specific requirements of the store locator functionality and may not align with other distance measurements.
Why it doesn’t Calculate Distance? #

Agile Store Locator doesn’t perform real-time distance calculations due to inherent limitations and feasibility challenges. Unlike services like Google Maps, which dynamically calculate distances based on live traffic and route data, Agile Store Locator doesn’t have access to such real-time information. Fetching precise path and road data for each store location via API calls to services like Google Distance Matrix API isn’t feasible for a list of stores, as it would incur significant costs and resource usage.