A simple game where you challenge Google Maps to travel across the U.S. to a number of cities in the shortest distance possible. You will be given a random selection of cities based on user input that you must travel through along with the origin where you must start and end at. At the end, the length in miles of your route will be calculated and compared with the fastest path that Google comes up with.

The project is built upon the Google Maps APIs that renders a version of Google Maps on the site. From there other tools such as the Google Directions API and the Google Geocoding API were used to make the map interactive, plot the routes on the map and translate addresses to and from latitude/longitude.

The list of cities used was generated using a python script that used the Google Geocoding API to get the coordinates based on a city name. From there a JSON file was created to be used by the main javascript files.

Side note: The game only supports up to 8 cities being played at a time because the Google API does not allow queries for routes with more than 8 cities at a once unless you have a Google API premium plan.

Share this project: