Test your driving directions skills (and our latest features)!

Wednesday, July 25, 2007 at 3:43:00 PM

I don't drive. Well, I used to, but then I realized I hated driving on highways, making left turns, and parallel parking. And then after a little incident, I hated making right turns too. So, I've taken up walking and (getting lost on) public transportation. This is all well and good except that I have no idea how to get anywhere besides the bus stop and the closest Wal-Mart, and this lack of knowledge can sometimes land me in not-so-fun situations. Sometimes I wish I did drive, just so I'd be forced to learn the streets around me.

But now, with the addition of driving directions in the API, I can use Google Maps to learn the optimal routes from point A to point B without ever leaving the house or venturing inside a wretched car. Below, you can play my driving directions game. After clicking the "Start New Game" button, a start (green) icon and an end (red) icon will appear. The goal of the game is to guess the (Google-calculated) route from the start to the end. After ending the game by clicking on the red icon to finish your route, you'll see the Google route show up in green and your score show up in the score board.

In the scoreboard, you can see an "AREA" score and a "LENGTH" score. The area score is my attempt to measure your deviation from the Google route, and is calculated by forming a shaded pink GPolygon from your route + Google's route, calling getArea() on the poly, and comparing it to the total area of the map. This isn't perfect, as sometimes the routes will cross eachother and cancel eachother out in the area formula. That's why I added the length score, which is calculated by calling getLength() on your GPolyline and the Google-calculated GPolyline, and comparing the results. If you can get a high score of 99.* in both AREA/LENGTH, then you're doing pretty well. Have fun!