image

Map-exercise 🗺️

In this challenge, you'll need to use the map from mapbox to print in real time the public transport of Los Angeles.

Tasks 📝

After have installed and initialized mapbox in your index.js you have to:

  • Center the map in Los Angeles, here the coordinates: [34.052235, -118.243683].
  • Use the Metro’s Realtime API you have to display the Los Angeles public transport in the map by making petitions to this endpoint https://api.metro.net/LACMTA/vehicle_positions/all. 🚌

Bonus 🏆

Create a code to refresh each 10 seconds and retrieve the new positions of the public transports and with a popup, display the ID of the vehicle.