Store Locator Plus searching is, as of version 3.5, solely based on radius driven searches. In simple terms the search works by finding all stores in your store list that are within X kilometers or miles from the address that is entered in the search form. The search is fairly simple to understand in a basic setup:
- User picks 10 miles from the radius pulldown on the form.
- User enters their complete address, usually for their home or business.
- User clicks “Find Locations”.
- A list of all the stores within 10 miles is returned and shown on the map.
Fairly easy to follow, but there are a lot of other ways people use Store Locator Plus. Below, we explain how search works in other situations.
Search By City/State/Country
A common question is why stores are not coming up when someone searches solely by a city, state, or country. For simplicity of discussion we will use “search by State” as our point of reference.
The most common culprit is a default radius that is set to a low value. The reason this is an issue is that the search is ALWAYS radius based. The way the system works is that it takes the selected state, asks Google what the geographic center of that state is, and uses the latitude/longitude Google returns as the starting search address.
The search then proceeds as per the steps outline above. If the center of a large state, say Texas, is selected and the radius is set to 100 miles then you may not see stores listed that are on the border of Texas. Setting a large enough default radius can solve this problem, though it will not restrict results to the selected state.
Why Search By Radius?
The design of the search is based on the premise that most people that are searching for something don’t care what state your store is in. They only care that it is 3 miles away not 30 miles away.
We understand this is not a perfect solution for everyone. Sometimes you need to refer someone to the proper sales agent based on sales territories which are typically based on state/city/country. We are considering an addition to the Enhanced Search premium add-on that will override the radius-only search with discreet searches by geographic entity.
Technical Details
The search algorithm converts the latitude and longitude of the starting search address and each store by using a spherical cosine formula. The short version of this is that the latitude and longitude are subtracted from each other and multiplied by 6371 kilometers or 3959 miles. This is the radius of the earth and is used to determine how far apart two points are on a perfect sphere.
As you know, the Earth is not a perfect sphere and thus this formula is an approximation. The closer your points are to one of the poles, the more varied the terrain, and other factors will dictate how accurate the results are. However, in most cases this is the accepted methodology and formula for finding the distance between two points when given the latitude and longitude on Earth.
Looking Under The Covers
I often get email asking why the search is broken. Sometimes I get a URL showing the problem. The fastest way for me to see what is going on is to use the web browser developer tools. These are built into IE and Chrome. For Firefox I use the Firebug add-on. All 3 will show all the JavaScript and AJAX trickery. I’ve even buried some helpful data in the JSON response coming back from the server when you perform a search so I can see what is happening without being intrusive.
Here is what a state search looks like. You can see that the CA selection puts the marker just outside Fresno. If you look in the JavaScript debugger (this one is Chrome Dev Tools) you can see the form data that was sent behind the scenes. It is searching for locations within 50 miles of the address “CA”. The address CA has a lat of 36.778261 and a long of -119.417932.
Here is the response where you can see the SQL query used in the location database, the version of SLP, and the results. Here the count of 0 shows now results. If you click the response tab you can see the list of locations (there are none).


