Loading game info...

Loading stadium info...

Loading hits...

= hit, = out, = home run, = double play ball

The above mashup loads hit location data from MLB Gameday data via YQL and jQuery. Data are transformed from an arbitrary pixel coordinate system to latitude-longitude points using methods I describe here. Data are presented on Google Maps satellite tiles, using Mapstraction as a wrapper. The accompanying YUI table shows the same data and allows selection of balls-in-play.

Please excuse the wait: the YQL queries typically take a few secs to gather the game, stadium, and hit data, but in rare cases queries can take upwards of a minute. In rarer cases the whole thing freaks out and you have to hit refresh.

By default (without a game specified as a url parameter), this page shows the 2009 all star game. To see another game, simply add a gid parameter to the URL. The gid parameter is composed as follows:

So, the default gid, the 2009 all star game, is gid_2009_07_14_aasmlb_nasmlb_1. A few other example games: Created by Zachary Forest Johnson of indiemaps.com. Just view source to see what's going on. Code is BSD licensed and available on github.