Skip to content

EwenH/leaflet-gsheets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leaflet-gsheets

How to create a simple Leaflet web map that automatically pulls data from two simple Google Sheets tables. Sidebar created using leaflet-sidebar-v2, and Google Sheets connection with PapaParse.

The resultant map can be seen here: https://rdrn.me/leaflet-gsheets/

I explained the process in more length in my blog post here: Leaflet maps with data from Google Sheets.

example

Steps

  1. Open the following two Google Sheets and copy them to your account (top left, "Add to My Drive")
  2. In each one, do the following three steps:
    • In Google Sheets, go to File -> Publish to the Web -> Publish
    • Choose "Comma-separated values (.csv)" in the dropdown on the right
    • Then copy the link provided just underneath, and save it somewhere
  3. Back in GitHub, Fork this repo (top right of this page)
  4. Either clone/download your new repo to your machine, or use GitHub's built-in code editor, and open leaflet-gsheets.js
  5. At line 20 where it says "PASTE YOUR URLs HERE", paste the URLs you copied above
  6. If you want to display your new website using GitHub Pages:
  7. Customise the Google Sheets with the data you want
  8. Customise the JavaScript however you want...

Get in touch if you need a hand!

About

Simple web map that live updates from Google Sheets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 72.5%
  • JavaScript 23.0%
  • HTML 3.5%
  • Python 1.0%