Evergreen Location Finder
A searchable list of your locations with a map, for any website. Visitors search by city or ZIP, press Near me to see the closest locations first, and tap Directions.
Keep your locations in a Google Sheet (or paste them into the page). Add a row and the finder updates, map pin included.
What's in the download
| File or folder | What it's for |
|---|---|
INSTALL.md | Step-by-step setup for Squarespace (every plan), WordPress, Wix, Webflow, Shopify, Ghost, Carrd and plain HTML |
templates/locations-template.csv | Spreadsheet template. Open it in Google Sheets or Excel. |
apps-script/Geocode.gs | The GEOCODE formula for Google Sheets: turns addresses into map coordinates |
embed/ | Ready-to-paste snippets. Start here. |
evergreen-locations.zip | The WordPress plugin. Upload it under Plugins → Add New → Upload Plugin. |
dist/location-finder.min.js | The compact script. Use it if you upload the file to your site. |
dist/location-finder.js | The readable script, for anyone who wants to look inside |
vendor/leaflet/ | The map library (Leaflet), if you'd rather host it yourself |
demo/index.html | Double-click to try it (the map needs an internet connection) |
LICENSE.txt | What your license allows |
The whole idea in two lines
<div data-location-finder data-src="YOUR-PUBLISHED-GOOGLE-SHEET-CSV-LINK"></div>
<script src="location-finder.min.js" defer></script>
Every option is another data- attribute on that div. See Options in INSTALL.md.
For developers
EvergreenLocations.init(); // start any new finders on the page
finderDiv.__elf.select("downtown-pantry", "list"); // highlight a location and show it on the map
window.EvergreenLocationsConfig = { // set before the script loads
leafletJs: "/assets/leaflet.js", // host Leaflet yourself instead of the CDN
leafletCss: "/assets/leaflet.css",
tiles: "https://tiles.example.com/{z}/{x}/{y}.png",
attribution: "© Example Maps"
};
Questions or installation help: use the contact page at evergreencode.store.
Installation
Every install has the same three parts:
- Your locations: a Google Sheet (recommended) or rows pasted into the snippet.
- Map coordinates: a latitude and longitude for each location, so it gets a pin. The GEOCODE formula fills these in for you.
- The snippet: one of the files in
embed/, pasted where the finder should appear.
Step 1: List your locations
Open templates/locations-template.csv in Google Sheets (File → Import → Upload) or Excel. One row per location:
| Column | What goes in it |
|---|---|
| Name (required) | The location's name, like Downtown Pantry |
| Address, City, State, Zip | The street address. Shown in the list and used for directions. |
| Phone, Website, Email | Optional. Shown as Call, Website and Email links. |
| Hours | Optional. Press Ctrl+Enter (Mac: ⌘+Enter) inside the cell for a new line. |
| Category | Optional type, like Food pantry or Clinic. Several? Separate them with commas. Types become filter buttons. |
| Description | Optional short note |
| Latitude, Longitude | Where the pin goes. See step 2. |
Column names aren't picky: "Location", "Postal code", "Tel", "URL" and "Type" also work. You can also use one Coordinates column with values like 35.4676, -97.5164 (the format Google Maps copies).
A location without coordinates still appears in the list, just not on the map.
Step 2: Add map coordinates
The easy way: the GEOCODE formula (Google Sheets)
- In your sheet, click Extensions → Apps Script.
- Delete what's there, paste the whole contents of
apps-script/Geocode.gs, and click Save (the disk icon). Close the tab. - In the first Latitude cell (L2 in the template), type: ``
=GEOCODE(B2&", "&C2&", "&D2&" "&E2)`` It fills in Latitude and Longitude. The first time, Google asks you to allow the script: click Allow (it only reads the addresses you give it). - Copy the formula down for every row.
It uses Google's own address lookup through your Google account, which has a generous free daily limit. Once your list is final, you can freeze the results: select the two columns, copy, then Edit → Paste special → Values only.
If a cell says Address not found, check the address or type the coordinates yourself.
By hand
In Google Maps, right-click the spot and click the numbers at the top of the menu to copy them (like 35.4676, -97.5164). Paste the first number into Latitude and the second into Longitude, or paste both into a Coordinates column.
Step 3: Publish your sheet
- Click File → Share → Publish to web.
- Under Link, choose your sheet tab, change "Web page" to Comma-separated values (.csv), and click Publish.
- Copy the link it shows. It contains
/pub?and ends inoutput=csv.
Use this link, not the address in your browser bar. A link ending in /edit won't work, and the finder tells you so if you paste one by mistake. Changes in the sheet appear on your site within about 5 minutes.
Or paste the rows
Use embed/2-pasted-data-embed.html and replace the example rows between the two script tags with your own (the first row is the column names). If a cell contains a comma or a line break, wrap it in "double quotes". The template shows how.
Step 4: Choose a snippet
File in embed/ | Use it when |
|---|---|
1-google-sheet-embed.html | One paste that does everything: your sheet link plus the script. Easiest. |
2-pasted-data-embed.html | You'd rather type your locations into the snippet than use a sheet. |
3-site-wide-script.html | Your builder has a site-wide footer code box. Paste it there once. |
4-finder-only.html | The script is already loaded (by file 3 or the hosted file) and you're adding a finder. |
5-hosted-file-embed.html | You can upload files to your site and want the shortest code. |
Most builders only run custom code on the published page. If you see a blank box or code while editing, check the live page or preview.
Squarespace
Works on Squarespace 7.1 and 7.0, in any template, on every plan.
Core, Plus or Advanced plans (legacy Business and Commerce)
Add a Code Block where the finder should go and paste embed/1-google-sheet-embed.html (with your sheet link) or embed/2-pasted-data-embed.html (with your rows).
Basic plan (legacy Personal): no upgrade needed
Basic and Personal plans don't run Code Blocks or Code Injection, but Markdown Blocks accept HTML on every plan.
This is a widely used workaround, but Squarespace doesn't officially support it and could change how Markdown Blocks behave in the future.
- Upload the script file. Edit any text block, highlight a word, click the link icon, then File → Upload file, and upload
dist/location-finder.min.js. Remove the temporary link afterward. The file is now at/s/location-finder.min.js. - Load it from your footer. Click Edit, hover over the footer, click Edit Footer, add a Markdown block and paste: ``
html <script src="/s/location-finder.min.js" defer></script>`` If your site has no footer, put this line in a Markdown block on the locations page instead. - Add the finder. Add a Markdown block where the finder should go and paste the line from
embed/4-finder-only.htmlwith your Google Sheet link. Keep it on one line.
Use the Google Sheet method with Markdown blocks. Don't paste rows or the whole script into a Markdown block, because Markdown can change symbols in them.
WordPress
- Go to Plugins → Add New → Upload Plugin, choose
evergreen-locations.zip, click Install Now, then Activate. - Add a Shortcode block and use either a sheet link: ``
[evergreen_locations src="YOUR-PUBLISHED-CSV-LINK"]`or paste rows between the tags, column names first:`[evergreen_locations] Name,Address,City,State,Zip,Phone,Latitude,Longitude Main Office,123 Main St,Springfield,IL,62701,(217) 555-0100,39.799,-89.644 [/evergreen_locations]
Shortcode options: search, filters, near_me, map, map_position, units, radii, zoom, height, accent, pin, start, show_category, tiles, attribution, class (same as the options below, with _ instead of -).
[evergreen_locations src="…" units="km" height="600" accent="#7b2cbf"]
The plugin includes the map library, so nothing loads from a code CDN. The script only loads on pages that have a finder. If a caching or speed plugin breaks it, exclude location-finder.min.js and leaflet.js from its "delay JavaScript" or "combine JS" settings.
Wix
Add Embed Code → Embed HTML, paste embed/1-google-sheet-embed.html or embed/2-pasted-data-embed.html, and drag the element tall enough (about 700 pixels). Wix shows embeds in a frame, and Near me may not work inside it on every browser.
Webflow
Paste embed/3-site-wide-script.html into Site settings → Custom code → Footer code once, then add an Embed element with embed/4-finder-only.html. Custom code needs a paid site plan.
Shopify
Online Store 2.0 themes: add a Custom Liquid section and paste embed/1-google-sheet-embed.html or embed/2-pasted-data-embed.html.
Ghost
Add an HTML card and paste embed/1-google-sheet-embed.html or embed/2-pasted-data-embed.html.
Carrd
Add an Embed element, set its type to Code, and paste embed/1-google-sheet-embed.html. Embeds need a Carrd Pro plan.
Any website (HTML)
Upload dist/location-finder.min.js and use embed/5-hosted-file-embed.html.
Options
Add any of these to the <div data-location-finder …> tag:
| Attribute | What it does | Example |
|---|---|---|
data-src | Your published Google Sheet (CSV) or CSV file link | data-src="https://docs.google.com/…output=csv" |
data-search | false to hide the search box | data-search="false" |
data-near-me | false to hide the Near me button | data-near-me="false" |
data-filters | none to hide the type buttons | data-filters="none" |
data-start | The type shown first (default All) | data-start="Clinic" |
data-map | false for a list with no map (and no outside requests) | data-map="false" |
data-map-position | left to put the map left of the list on wide screens | data-map-position="left" |
data-height | Height of the map and list side by side (default 560) | data-height="640" |
data-units | km for kilometres (default miles) | data-units="km" |
data-radii | Distances in the Within menu after Near me | data-radii="5,10,25" |
data-zoom | How close the map zooms to one location (default 14) | data-zoom="12" |
data-show-category | true to show each location's type in the list | data-show-category="true" |
data-accent | Color for buttons, links and pins | data-accent="#1d5c45" |
data-pin | A different color for map pins | data-pin="#c2410c" |
data-text-search | Search box placeholder | data-text-search="Search by town" |
data-text-near-me | Rename the Near me button | data-text-near-me="Closest to me" |
data-text-all | Rename the All button | data-text-all="Everything" |
data-text-directions | Rename the Directions link | data-text-directions="Get directions" |
How "Near me" works
When a visitor presses Near me, their browser asks whether to share their location. If they allow it, the list is sorted nearest first with distances, the map shows their position, and a Within menu appears for narrowing by distance. Their location stays in their browser: it isn't sent anywhere. It needs a secure (https) page, which Squarespace, WordPress hosts and the other builders all provide.
Searching by city, ZIP or name works without sharing a location.
About the map
Maps are drawn with Leaflet, a free open-source map library, using OpenStreetMap's free map images. The map shows the required "© OpenStreetMap contributors" credit in its corner. Keep it there.
OpenStreetMap's free map images are meant for ordinary websites. A site with very heavy traffic should switch to a map image provider; many have free plans. Set it with data-tiles and data-attribution:
<div data-location-finder data-src="…"
data-tiles="https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}.png?api_key=YOUR-KEY"
data-attribution="© Stadia Maps © OpenMapTiles © OpenStreetMap contributors"></div>
The map library loads from unpkg.com, a public code CDN, with an integrity check. To host it yourself, upload the files in vendor/leaflet/ and see README.md.
Directions links open Google Maps with the location filled in, which opens the Maps app on phones.
Styling
Add to your site's custom CSS (Squarespace: Design → Custom CSS, available on every plan; WordPress: Appearance → Customize → Additional CSS):
[data-location-finder] {
--elf-accent: #1d5c45; /* buttons, links, selected card */
--elf-on-accent: #ffffff; /* text on buttons */
--elf-pin: #1d5c45; /* map pins */
--elf-radius: 12px; /* card and map corners */
--elf-height: 560px; /* map and list height side by side */
}
The finder uses your site's font and text color automatically. Side by side needs about 760 pixels of width; narrower spaces and phones show the map above the list.
Troubleshooting
"The locations couldn't load." On your live site this message stays general. Open the page in the Squarespace editor or WordPress preview, or your browser's console, to see the exact reason. Most often it's a Google Sheet link that isn't the Publish to web → CSV link.
A location says "Not on the map." Its Latitude or Longitude is empty or not a number. Check the GEOCODE cell for that row.
The map is blank or says it couldn't load. A content blocker or a strict site security setting may be blocking unpkg.com or the map images. The list still works. Host Leaflet yourself (see above) or allow those addresses.
Near me does nothing. The visitor declined to share their location, or the page isn't on https. A message appears under the search box.
Changes in my sheet don't show up. Google refreshes published sheets every few minutes. Wait, then reload.
Still stuck? Use the contact page at evergreencode.store. Installation help is included for 6 months.
Changelog
1.0.0 (2026-11-08)
First release.
- A list of locations with a map, from a Google Sheet, a CSV file or rows pasted into the page.
- Search by name, city, state or ZIP; type buttons built from your categories.
- Near me: sorts by distance from the visitor, shows their position, and adds a "Within" distance filter (miles or kilometres).
- Map pins in your accent color; clicking a name shows it on the map, clicking a pin highlights it in the list.
- Call, Website, Email and Directions (Google Maps) links; hours and notes with line breaks.
- Side by side on wide screens, map above the list on phones; list-only mode with
data-map="false". - GEOCODE formula for Google Sheets (Apps Script) that turns addresses into coordinates.
- Maps by Leaflet and OpenStreetMap, with options for your own map images or self-hosted Leaflet.
- WordPress plugin:
[evergreen_locations]with a sheet link or pasted rows; Leaflet bundled. - Install guides for Squarespace (every plan, including Basic/Personal via Markdown Blocks), WordPress, Wix, Webflow, Shopify, Ghost, Carrd and plain HTML.
- Keyboard and screen-reader support; respects reduced motion; shielded from site-wide styles.