This filter enables you to modify the parameters included in the geocode component filter.
If you, for example, search for Springfield, then the first result the Geocode API returns is located in Massachusetts. Which is fine if your store is actually located in Massachusetts, but if it’s located in Illinois, then the only thing the user will see is a “No results found” message.
To fix this you can use this filter to restrict the results by administrativeArea, country, locality, postalCode and route.
This only works if a default map region is selected on the settings page, and the “Restrict the geocoding results to the selected map region?” checkbox that shows up after selecting a map region is enabled as well.
This example restricts the returned geocode results to Illinois:
This filter is located in /frontend/class-frontend.php
The code needs to be placed in the functions.php file inside your active theme folder.