Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    The way the search works is that a request is first made to the Geocode API for the coordinates of the searched query. The returned coordinates are then used in combination with the provided search radius to calculate which store locations are returned.

    The used coordinates are always the center of whatever you searched for, and since a state can be quite big, most ( if not all ) locations will likely fall outside the set search radius.

    This is why searching for countries / states is a bad idea, the area is to big to fall within a normal search radius. You of course change the default search radius on the settings page, and set it to a larger value.

    In the future I will make an option that auto generates a list of used states. So selecting them will automatically show the locations that fall within the selected state.

    Thread Starter Lu.diehl

    (@ludiehlgmailcom)

    Thanks for the quick response Tijmen,

    It’s weird bc we have lots of stores in certain states, e.g. NY, NC, SC and some other states work perfectly fine. But CA and AZ won’t…

    The option to select a used state instead of searching for it would be ideal!

    We wanted to keep the search bar super simple, any suggestions on how to change the setting so searching by state would show results?

    https://www.rootsfood.com/store-locator/

    Plugin Author Tijmen Smit

    (@tijmensmit)

    It’s weird bc we have lots of stores in certain states, e.g. NY, NC, SC and some other states work perfectly fine. But CA and AZ won’t…

    The marker is placed in the middle of whatever you search for. So if results show up for state x,y,z, then your locations just happens to be close to the middle of the coordinates returned by the Geocode API, and within the set search radius.

    If you set a large default search radius on the settings page ( the value between [] ) then more locations show up. You will have to experiment a bit with which value works for CA and AZ.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search by state name not working’ is closed to new replies.