Sitecore SXA location finder filter by Country

Recently we have been working on a Sitecore Experience Accelerator (SXA) implementation for a large housing company in UK
One of the requirements was to provide a Search solution with :
- Location finder to search properties in a region or postcode
- Filter (Radius) — used to reduce the search results by geospatial comparison.
- Map View of the searched properties
- Location finder Auto complete should display suggestions for UK region only
The first three requirements can be implemented with SXA OOTB components (location finder , Radius filter , Maps) with absolutely no coding effort ! , I will not go over our implementation in this blog post , Micheal West’s excellent blog on SXA location Search should point you in the right direction
But, SXA(1.8.1) Location finder at the moment does not provide an option to filter suggestions based on location , this would require come backbone JS customization
- Duplicate the maps connector OOTB file under /sitecore/media library/Base Themes/Google Maps JS Connector/Scripts/google-maps-connector


2. Replace the api.LocationAutoComplete Function with the code below
3. Update Country Code to your desired country , Save and Publish the updated file
The Location Finder should now filter suggestions based on the country provided

Happy Sitecoring :)