Skip to content

Commit 865ee46

Browse files
committed
Update README.md
1 parent 8719b0f commit 865ee46

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,36 @@ To geocode (find latitude and longitude coordinates), we recommend installing th
2222

2323
See Steps G or H in the tutorial https://handsondataviz.org/leaflet-maps-with-google-sheets.html
2424

25-
#### Problem: The map I created here before September 2020 is not working
26-
Google Sheets changed its API from version 3 to version 4 in September 2020, which breaks prior versions of the map, so we made several updates to the code. To make your pre-Sept 2020 maps work again, here are three options, A-B-C:
25+
## Problem: The map I created before September 2020 is not working
26+
Google Sheets changed its API from version 3 to version 4 after Sept 30th 2020, which will break versions of the map made prior to this date. We also made several updates to the code, including adding a Google Sheets API key that's necessary to use version 4. To make your pre-Sept 2020 maps work again, here are four options, A-B-C-D:
2727

28-
Option A: Use your existing code and pull your data from CSV files rather than a linked Google Sheet.
28+
Option A: Use your existing code and pull your data from CSV files rather than a linked Google Sheet. This avoids the need for a Google Sheets API key, but does not take advantage of our other code updates.
2929

3030
1. Go to your linked Google Sheet, and for each tab, *File > Download* in CSV format, and rename them this way: Options.csv, Points.csv, etc.
3131
2. Log into the web interface of your GitHub map repo.
32-
3. Create a new subfolder named `csv` in your GitHub repo. Go to *Add file > Create a file* and type in `csv/`. The forward slash indicates it is a folder, not a file.
33-
4. Upload each CSV file you created into this new `csv` subfolder in GitHub. The code automatically searches for CSV files before searching for a linked Google Sheet, which means your Google Sheet is no longer needed.
32+
3. Create a new subfolder named `csv` in your GitHub repo, by selecting *Add file > Create a file* and typing in `csv/`. The forward slash indicates it is a folder, not a file.
33+
4. In your GitHub repo, upload each CSV file you created into this new `csv` subfolder.
34+
5. In your Github repo, open the `google-doc-url.js` file, scroll to the bottom of the page, and delete it.
35+
Now the code automatically searches for data in your CSV folder, rather than your Google Sheet. If desired, you can continue to use the Google Sheet to edit your map content and upload those changes to the CSV folder each time, or edit the CSV files directly.
3436

3537
OR
3638

37-
Option B: Make a copy of our newer code by clicking the green 'Use template' button. Migrate any media or geodata content from your old repo to your new repo. Reconnect your Google Sheet to your new repo.
39+
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.
40+
41+
Advice: 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.
42+
Warning: Since this operation might overwrite some of your code, go to *Code > Download ZIP* to make a backup to your local computer.
43+
1. Log into the web interface fo your GitHub map repository.
44+
2. Click *Pull requests* and click the green button for a *New pull request*.
45+
3. On the *Comparing Changes* page, use the menus to pull code *into* your repo *from* the original repo, named HandsOnDataViz/leaflet-maps-with-google-sheets. GitHub may warn that you cannot automatically merge the files, but proceed anyways.
46+
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.
47+
48+
OR
49+
50+
Option C: If you understand (or are willing to learn about) [GitHub Desktop](https://handsondataviz.org/github-desktop-atom.html), use it to move copies of the newer code (index.html, scripts 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.
3851

3952
OR
4053

41-
Option C: Use GitHub Desktop to move copies of the newer code (index.html, scripts folder, etc.) into your repo via your local computer.
54+
Option D: 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.
4255

4356
## Credits (and licenses)
4457
Developed by [Ilya Ilyankou](https://github.com/ilyankou) and [Jack Dougherty](https://github.com/jackdougherty) with support from Trinity College CT. Inspired by Code for Atlanta mapsfor.us (2016) https://github.com/codeforatlanta/mapsforus (BSD-3-Clause)

0 commit comments

Comments
 (0)