Demo site using several technologies, including Mapbox GL JS, Bootstrap, Flask, and dynamic data from Google's Earth Engine, to explore a sample of study sites from the ECCO project.
- Python 3.6
- Mapbox Access Token
- Optional: Heroku command line tools
- Google Service Account, authorised to use Earth Engine.
After obtaining a Mapbox access token (which are free with a mapbox account) you should export MAPBOX_ACCESS_TOKEN='XXXX'
to your local environment.
Next install the Python dependencies specified in the requirements file via: pip install -r requirements.txt
You will then need to export a flask environment variable export FLASK_APP=lake_site.py
Finally, run the server via flask run
, if all went well the site
should be accessible at localhost:5000
Note, you can also run via flask run --host=0.0.0.0
to expose the site to devices across your local network. (You should then find the site at https://<my_IP>:5000
.)
Follow the above steps, except instead of running via the flask command, run via heroku local
. Note this will require you to download the Heroku command line tools.
To deploy on Heroku you will need to create several environment variables (read config vars
in Heroku-speak):
- MAPBOX_ACCESS_TOKEN
- auth_provider_x509_cert_url
- auth_uri
- client_email
- client_id
- client_x509_cert_url
- private_key
- private_key_id
- project_id
- token_uri
- type
Note, the Service account config vars are taken from the JSON version of the Service Account credentials.