Skip to content

Interactive map showing showing earthquake impacts using JavaScript and Mapbox.

Notifications You must be signed in to change notification settings

inregards2pluto/mapping-earthquakes

Repository files navigation

Mapping Earthquakes

Interactive map showing earthquake impacts using JavaScript and mapbox. Earthquake data is obtained from USGS.

How to Use

Setup

Clone the "Earthquake_Challenge" subdirectory onto a local device. In the terminal, navigate to the "Earthquake_Challenge" directory. Create a new file called "config.js" in the "js" directory (nested inside the "static" directory). Add the following to the config.js file:

// API key
const API_KEY = "";

To utilize this code, users will need to create an account with Mapbox and aquire an API key. Copy the api key and paste it between the quotation marks in the config.js file. Once this is done, execute the following code in Git Bash:

python -m htpp.server

Open the web browser and navigate to http://localhost:8000/. If everything is setup correctly, a map should open in the browser that looks like the following:

Fig 1

Navigating Map

Three major features are overlayed on this map: all earthquake locations, major earthquake locations (greater than 4.5 magnitude), and tectonic plates.

The color and size of the markers correlate to the magnitude of the earthquake. Clicking on any marker will open a popup window with information on the magnitude and location of the event. Clicking on a tectonic plate line will open a popup with info on the name of the line and which two plates make up the line.

Fig 2

To change the basemap, click on the layers button in the upper right hand corner of the window. A dropdown window will appear.

Fig 3

Choosing any of the basemap layers will cause the map to update automatically.

Fig 4

To turn layers on and off, click on the checkboxes.

Fig 5

Resources

All Earthquake Data: USGS
Major Earthquake Data: USGS
Tectonic Plate: Hugo Ahlenius, Nordpil and Peter Bird
Basemap Layers: Mapbox.com

About

Interactive map showing showing earthquake impacts using JavaScript and Mapbox.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published