Saturday, July 02, 2005

Chicago Reader plus Google Maps

I'm joining the club of coolpeople who hack Google Maps.

Late last night (like from 1 to 4, I don't know why) and this afternoon I hacked together a merging of Google Maps and Chicago Reader rental classifieds. I give you the result (it takes a while to load).

I like a lot, but Chicago Reader (so I've been told) is one of the best ways to find a place to live in Chicago. Craigslist is so-so. Compare the results on the two maps and you'll see that it's true.

Step one: Perform a search and copy-and-paste the resulting URL into my code. You're looking at 1 bedrooms in 60613, 60614 and 60657, priced between $600 and $1000.

There are two ways to find the location of a property. If the classified ad has a map link, I don't need to find the address. I can follow the link; it redirects me to a new URL that has the GPS coordinates in the query string.

Method two involves me parsing: "Street1 and Street2" or "#### (Direction) StreetName". It's not perfect, but it's pretty good. I can then ask Google to attempt find the coordinates from the address I harvested. In total, I can find the coordinates of about 80% of the ads.

After that, I generate some javascript (ads.js) that defines the coordinates and descriptions in a giant array. I can manually upload that to my hosting provider, and index.html references it. Tada!

If anyone's interested in the source (C#), drop me a line.

Kudos to Google Maps on such an excellent and interoperable product.

No comments: