• Stars
    star
    295
  • Rank 140,902 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scroll-driven story map, with point markers and narrative text in GeoJSON, using Leaflet and jQuery

Leaflet Storymaps with Google Sheets

Customize your Leaflet story map with linked Google Sheets template and scrolling narrative. Supports images, audio and video embeddings, and Leaflet TileLayer/geojson overlays.

Live links (replace with your own)

Create Your Own

Geocode your address data with Google Sheets add-on

To geocode (find latitude and longitude coordinates), we recommend installing the free Geocoding by SmartMonkey add-on for Google Sheets. Insert your addresses in place of the samples in the Geocoding Details tab, then use Add-Ons > Geocoding > Geocode Details menu. Learn more in Hands-On Data Visualization https://handsondataviz.org/geocode.html

Geocoding

To finalize your map, you need to either:

  • Download each Google Sheets tab as a CSV file and upload into a csv subfolder in your GitHub repo
    • OR
  • Get your own Google Sheets API Key to insert into google-doc-url.js

See more in the tutorial https://handsondataviz.org/leaflet-storymaps-with-google-sheets.html

Update your code for any pre-October 2020 storymaps before January 2021

If you used our code to create a storymap prior to October 2020, you will need to update your version before January 26, 2021 for it to continue to work. Google announced that it will migrate from Google Sheets API v3 to v4 in Jan 2021, and we released our update of Leaflet storymaps code v1.2 on September 29th to address Google's changes.

Three options to update your code:

Option A: If you understand (or are willing to learn about) GitHub Desktop, use it to move copies of the newer code (index.html, scripts folder, markers folder, style.css, etc.) into your repo via your local computer. In the google-doc-url.js file, copy and paste the Google Sheets API key that appears in the lower half of our code, but keep your own Google Sheets ID that appears in the upper-half of your code.

OR

Option B: If you originally "forked" a copy of our code, create a GitHub "pull request" to update your repo with our code revisions, including the Google Sheets API key. We recommend this option only if you understand (or are willing to learn about) GitHub pull requests, and can deal with resolving conflicts between your code and our updated code. Warning: Since this operation might overwrite some of your code, go to Code > Download ZIP to make a backup to your local computer.

  1. Log into the web interface of your GitHub storymap repository.
  2. Click Pull requests and click the green button for a New pull request.
  3. On the Comparing Changes page, use the menus to pull code into your repo from the original repo, named HandsOnDataViz/leaflet-storymaps-with-google-sheets. GitHub may warn that you cannot automatically merge the files, but proceed anyways.
  4. You may need to click the Resolve conflicts button on the next screen, which means you need to sort out which portions of your code to keep and which portions of our code to accept. Generally speaking, you should accept our updates for index.html, style.css, and most scripts.js, while keeping your own content for README.md, media, and geojson folder content. In the google-doc-url.js file, you should keep your own Google Sheet ID, but temporarily add our Google Sheets API key until you create your own. In GitHub, you can resolve code conflicts by deleting/keeping lines in specific files.

OR

Option C: Start over with a brand-new repo, and migrate your existing map content. Make a copy of our newer code by clicking the green 'Use template' button. Migrate any media folder or geodata folder content from your old repo to your new repo, by downloading to your local computer and uploading to GitHub. Reconnect your Google Sheet ID to the google-doc-url.js file in your new repo.

Email us at [email protected] if you need assistance with updating your code.

Credits (and licenses)

Developed by Ilya Ilyankou and Jack Dougherty with support from Connecticut Humanities and Trinity College, CT. Inspired by Code for Atlanta mapsfor.us (2016) https://github.com/codeforatlanta/mapsforus (BSD-3-Clause). Adapted from MUX Lab, Map Effects 100: https://github.com/muxlab/map-effects-100, see http://muxlab.github.io/map-effects-100/Leaflet/11_scroll-driven-map-navigation.html.

We use Google Sheets API version 4, with these open-source components:

More Repositories

1

book

Hands-On Data Visualization: Interactive Storytelling from Spreadsheets to Code is an open-access book, also published with O'Reilly Media.
TeX
295
star
2

leaflet-maps-with-google-sheets

Customize Leaflet maps with a linked Google Sheets template and GeoJSON data on GitHub
JavaScript
143
star
3

leaflet-map-csv

Simple Leaflet map with points from local CSV file
HTML
41
star
4

leaflet-map-simple

Simple Leaflet map template for new users to fork, edit, and host
HTML
16
star
5

leaflet-heatmap

Leaflet.js heatmap template
HTML
14
star
6

leaflet-map

Leaflet map template to load local and remote files (GeoJSON, tileLayer, tileLayer.WMS) directly into legend toggle (L.control.layers) with simple jQuery call
JavaScript
14
star
7

leaflet-maps-open-data-apis

Leaflet map with multiple API data feeds from Socrata and Esri ArcGIS Online
HTML
11
star
8

chartjs-templates

Chart.js templates reading data from .csv by HandsOnDataViz.org
JavaScript
10
star
9

leaflet-map-polygon-hover

Leaflet thematic polygon (choropleth) map, with hover info window, using GeoJSON data
JavaScript
8
star
10

leaflet-map-polygon-tabs

Leaflet thematic polygon map, with hover info, tabs to display time periods, and data drawn from GeoJSON file
JavaScript
7
star
11

chartjs-line

Line chart with Chart.js (template)
JavaScript
7
star
12

leaflet-point-map-sidebar

Leaflet Point Map with Sidebar with Google Sheets
JavaScript
6
star
13

leaflet-maps-with-google-sheets-polygons

Leaflet Maps with Google Sheets - polygons only for teaching purposes
JavaScript
6
star
14

chartjs-error-bars

Error Bars in Chart.js (template)
JavaScript
4
star
15

chartjs-scatter

Scatter Chart in Chart.js (template)
JavaScript
4
star
16

chartjs-bubble

Bubble Chart in Chart.js (template)
JavaScript
3
star
17

chartjs-bar

Bar chart with Chart.js (template)
JavaScript
2
star
18

highcharts-scatter-csv

Highcharts XY scatter chart template with CSV data
HTML
2
star
19

census-divisions-hartford

Census boundary division maps built with Jupyter for HandsOnDataViz.org book
Jupyter Notebook
2
star
20

survey-results

HandsOnDataViz Survey Results VIsualization
Jupyter Notebook
1
star
21

bookdown-template

Bookdown template for Hands-On Data Visualization
TeX
1
star
22

highcharts-line-annotated

Annotated line chart with Highcharts (template)
JavaScript
1
star
23

leaflet-how-to-lie-with-maps

learn to detect bias by creating opposing maps of the same data
JavaScript
1
star