= 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:
gid_{year}_{month}_{day}_{away_team}mlb_{home_team}mlb_{game_number}
gid
, the 2009 all star game, is gid_2009_07_14_aasmlb_nasmlb_1
. A few other example games:
gid_2009_07_23_tbamlb_chamlb_1
: Rays at White Sox, July 23, 2009 (Mark Buehrle's perfect game)gid_2009_05_22_phimlb_nyamlb_1
: Phillies at Yankees, May 22, 2009 (includes 2009's longest homer, 477 ft. by Raul Ibanez)gid_2009_05_03_oakmlb_seamlb_1
: Athletics at Mariners, May 3, 2009 (the longest game this season)