Who Should Use This Guide
For: Business owners and developers adding store locator functionality without complex setup. You’ll need: A Loqate API key, store locations with addresses or coordinates, and basic HTML knowledge. Not covered: Tag-based integrations or advanced map customizations.What You’ll Build
A store locator that:- Finds nearest stores based on user’s location or search
- Calculates road distances and travel times
- Displays results on an interactive map
- Shows store details (address, hours, phone)
- Works globally with your store locations
Quick Start
To set up Store Finder, you’ll need an API key. Find out how to get yours here. Note: Store Finder requires two keys (Service Key and Management Key). These are automatically generated when you create a Store Finder service in your account.Upload Your Store Locations
Option A: Via Account UI- Go to account.loqate.com
- Create a Location List
- Upload CSV with your stores (address, name, phone, hours, etc.)
- Enable “Geocode Address” if you don’t have coordinates
Add Your Keys
ReplaceYOUR_SERVICE_KEY and YOUR_LOCATION_LIST_ID in the code with your actual keys.
Test
- Open your page
- Enter a location like “Boston, MA” or allow browser geolocation
- See nearest stores with distances
- Click markers to see store details
Store Finder calculates road-based distances (not straight-line). Results include drive time estimates based on typical road speeds.
Sample Project: Retail Store Locator
This walkthrough shows how to build a complete store locator with map. Follow along to see it built step-by-step.This is a detailed walkthrough. If you just want working code, skip to Complete Store Locator Example.
What We’re Building
A store locator that:- Accepts user location input or uses browser geolocation
- Calls Distance Finder API to find nearest stores
- Displays results in a list with distances and drive times
- Shows stores on an interactive map with clickable markers
- Responsive design that works on mobile
How Store Finder Works
Store Finder uses a three-step process:1. Get User Location
Option A: Address search- User types city, ZIP code, or address
- Use Geocoding API for suggestions
- Get coordinates for selected location
- Request user’s current position
- Get coordinates directly from browser
2. Find Nearest Stores
API: Distance Finder- Send user’s coordinates + your Location List ID
- API calculates road distances to all stores
- Returns nearest stores sorted by distance
- Includes drive time estimates
LocationListId- Your uploaded store listOriginLatitude/OriginLongitude- User’s locationMaxResults- How many stores to return (default 10)MaxDistance- Search radius in km (default 100km)
3. Display Results
List view:- Show store names, addresses, distances
- Display drive time estimates
- Include phone numbers, hours, etc.
- Plot stores as markers
- Center map on user location
- Click markers for store details
- Use Mapping API for map tiles
Complete Store Locator Example
Here’s a production-ready store locator with map, search, and geolocation: Features:- Address search with geocoding
- Browser geolocation (“Use My Location” button)
- List view with distances and drive times
- Interactive map with store markers
- Store detail popups on marker click
- Responsive mobile-friendly design
- Copy the code
- Replace
YOUR_SERVICE_KEYandYOUR_LOCATION_LIST_ID - Save as an HTML file
- Open in a browser to test
- Customize styling to match your brand
This example uses MapLibre GL JS for map rendering. The map library is loaded from CDN and requires no additional setup.
This example searches for the 10 nearest stores within 100km. Adjust
MaxResults and MaxDistance parameters based on your needs.Code on GitHub
If you’d like to browse the code snippets in this implementation guide or clone them, visit the repository on GitHub.Integration Tips
Adding to Your Existing Site
To add store locator to your current website:-
Add the map library to your page’s
<head>section- MapLibre GL JS (recommended)
- Or Leaflet / Tangram
-
Add the locator functions from the integration example to your page’s
<script>sectiongetMapTiles()for map renderingfindNearestStores()for distance calculationsdisplayResults()for showing stores
-
Add the HTML structure for search input, results list, and map container
- Search input field
- Results container div
- Map container div
-
Add the CSS styles from the integration example
- Map dimensions and positioning
- Results list styling
- Mobile responsive styles
Managing Store Locations
Updating store lists: Via Account UI:- Edit locations individually
- Bulk upload new CSV (replaces entire list)
- Delete individual locations
Search Radius and Performance
Default values:MaxDistance: 100kmMaxResults: 10 stores
locations_us- US storeslocations_uk- UK storeslocations_eu- European stores
Geocoding User Input
Option 1: Global Geocoding (Recommended) Direct address to coordinates - include country for best results:Important: For best results, include country in searches (e.g., “London, UK” not just “London”). Ambiguous locations may return no coordinates.
Browser Geolocation
Request user’s current location:Displaying on Map
Step 1: Get map tilesStore Data Structure
Include these fields when creating your location list: Required:Name- Store nameLatitude- Coordinate (if you have it)Longitude- Coordinate (if you have it)Address- Full address (if no coordinates)
Address1,Address2- Street addressCity,State,PostalCode- Location detailsPhone- Contact numberHours- Opening hoursServices- Available servicesCustomField1-5- Any additional data
Styling Customization
Customize the store locator to match your design: Map styling:Troubleshooting
Invalid API Key
Verify you’re using the Service Key (not Management Key) for Distance Finder and Mapping API calls. Management Key is only for Create/Update/Delete operations.No Stores Found
Check:- Location List ID is correct
MaxDistanceradius is large enough- User’s location is within range of your stores
- Location list has coordinates (not just addresses)
Map Not Loading
Check:- Map tile URL is recent (expires after 1 hour)
- MapLibre GL JS library is loaded
- Map container has defined height in CSS
- Browser console for JavaScript errors
Distances Seem Wrong
Distance Finder calculates road-based distances (not straight-line). Drive time estimates assume typical road speeds. Results may vary from GPS navigation due to:- Real-time traffic conditions
- Route preferences
- Updated road networks
Geolocation Not Working
Check:- Site is served over HTTPS (required except localhost)
- User granted location permission
- Browser supports geolocation API
- Timeout values are reasonable (10 seconds recommended)
Performance Issues
Optimize by:- Reducing
MaxResults(fewer stores returned) - Reducing
MaxDistance(smaller search radius) - Splitting stores into regional lists
- Caching map tile URLs (valid 1 hour)
Data Privacy
- Store locations stored in Loqate systems
- User searches logged for 30 days for operational purposes
- Geolocation data not stored (processed in browser only)
- See Privacy Policy for complete details
Support
- Create List Endpoint API Reference
- Distance Finder Endpoint API Reference
- Mapping Endpoint API Reference
- Contact

