A store (or agent) locator using Google Sheets as a datastore.
Google Sheet that I used for the demo: https://docs.google.com/spreadsheets/d/1El-pprddUkI27wLNYRh1wQX31DRjya4WOZAOHMa6lMg/edit#gid=0
I coded this to be able to handle large datasets. The dataset for the demo has over 10k stores. Using Sheetrock, I am able to query the sheet for a subset of the data needed based on user's origin (using a geo-bounding box). Once the data is loaded, I use a Haversine formula in Javascript to find the distances to origin for each store and then filter the closest locations.
For the spreadsheet, the only required columns are latitude and longitude (must be labeled "lat" and "lng") but of course you will want to add some more interesting info like name, address, hours, etc.
I've also added a custom function to the spreadsheet that will geocode the locations for you if you don't have the latitude and longitudes. To use the function, you must have a column that stores the full address of the location. If either of the lat and lng columns are empty, the function will fill it in:
Handlebars.js is used for templating. After setting up your spreadsheet, simply change the variables in the handlebar template to match your column headings. To keep things simple, I suggest using simple, lowercase column headings without spaces (e.g. "address1" instead of "Address 1", and "postalcode" instead of "Postal Code", etc.)
Note: Not affiliated with Starbucks in any way. For demo purposes only! The data powering this demo is old and definitely outdated. Use at your own risk!
Created by: