This is a more complicated version of the Basic Heroku Flask App lesson: https://github.com/datademofun/heroku-basic-flask.
It contains a skeleton of a Flask app that talks to the Google Maps API and USGS earthquake data.
A more polished project can be found at: https://github.com/datademofun/heroku-flask-quakes-lesssimple
Try to add the features found in the lesssimple version of this app and deploy it to Heroku.
The features include:
- Each place name of an earthquake should link to the earthquake's official USGS eventpage URL, i.e. http://earthquake.usgs.gov/earthquakes/eventpage/us10005c88
- Each row should show the correct Google static map, not an image of Stanford.
- There should be a Google static map that shows every earthquake.
Earthquake data comes from the USGS: http://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php
Example Google Static Map URL:
https://maps.googleapis.com/maps/api/staticmap?size=600x300&markers=Stanford,CA
What it looks like:
Google documentation for the static maps API: https://developers.google.com/maps/documentation/static-maps/intro#URL_Parameters
Some examples of how to use the urllib.parse.urlencode method to create complicated query strings.
Try this out:
from urllib.parse import urlencode
GMAPS_URL = 'https://maps.googleapis.com/maps/api/staticmap?'
locations = ['Stanford, CA', 'Berkeley, CA', 'Napa, CA']
myparams = {'size': '800x400', 'maptype': 'satellite', 'markers': locations}
url = GMAPS_URL + urlencode(myparams, doseq=True)
# https://maps.googleapis.com/maps/api/staticmap?size=800x400&maptype=satellite&markers=Stanford%2C+CA&markers=Berkeley%2C+CA&markers=Napa%2C+CA
Which renders this map: