malaydhamelia / corona_update

Simple web map that live updates from Google Sheets

Home Page:https://rdrn.me/leaflet-gsheets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 Tabletop.js.

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.

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 (and then close the dialog)
    • Then click Share in the top right -> Get Shareable Link (ensure "Anyone with the link can view" is enabled)
    • Copy the link provided and keep it aside
  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

https://rdrn.me/leaflet-gsheets

License:MIT License


Languages

Language:CSS 74.3%Language:JavaScript 20.7%Language:HTML 4.0%Language:Python 1.0%