PATH is the subway system that connects Jersey City and Manhattan, using PATH's public API, I created markers for each station and by clicking on the marker you get to see the status and ETA for the trains at the station.
This is an exercise on manipulating APIs and displaying data to the user in real time. Using free API from PATH trains and Mapbox, I built this simple map with all the locations of the PATH Train Stations in NJ and Manhattan. The code works by pining the PATH API and requesting real-time ETA for each station and using Mapbox's capabilities in order to display the ETA details within a box by clicking on each marker on the map.
- Runs on latest versions of Chrome, Edge, Safari, and Firefox.
- Download the files.
- Open PathTransit_Mapbox.html
Download the zip folder with the source code file and open the index.html on the browser of your choice.
- Make train ETAs update on its own every 15 or 30 seconds.
- Add status icons to popups: green for ontime, red for delayed, etc.
MIT License - Copyright (c) 2022 Thiago Petrimperni Lincense Link
Thiago Petrimperni Student at MIT - Full Stack Development with MERN