CTA train tracker uses the Chicago Transit Authority API in conjunction with Google Maps API V3 in order to map realtime GPS data to a visual overview of Chicago. Every 5000ms requests for each train route are made to the CTA API, then the returned JSON data is stored in an array of objects which is then mapped used the Google Maps API. Key features include: color coded lines, train filtering based on train line colors, and heading detection (the markers face either north, south, east or west depending on GPS heading data).
- Vanilla Javascript
- Node.js (Used for CORS proxy)
- Chicago Transit Authority API - Used for retrieving train data
- Google Maps Javascript API
- Heroku - CORS Proxy built in Node.js
Desktop | Mobile |
---|---|
- Clone this repository
git clone https://github.com/ppiwo/CTATransitTracker.git
- Create a new file in
./config.js
const API_KEY = "{YOUR CTA API KEY}";
- Open index.html in your favorite editor, on line 24 replace
{YOUR GOOGLE MAPS API KEY HERE}
with your Google Maps API key - Open index.html in your favorite web browser
Feedback is always welcomed and highly appreciated. If you notice any improvements I can make in my code please feel free to drop a comment. Thanks!