Writing Google Maps Applications with Rails and Ajax
Posted by josh February 16, 2007 @ 05:20 PM

Andre Lewis is rolling out a duo of resources for those of you creating mashups and Google Maps-based applications.
Andre's book, Beginning Google Maps Applications with Rails and Ajax: from Novice to Professional will be available Feb 26 from Apress. The book covers the basics (getting a Google map up and running, interacting with the the Google maps API in JavaScript), as well as more advanced topics. For example, later chapters show you how to use RMagick to display hundreds of thousands of points on a map by generating custom map tiles, and how to create your own geocoder from US TIGER/Line census data. The book also touches on screen scaping and bulk data manipulation -- for example, processing large text files from the command line using Ruby, and the performance implications of a pure ActiveRecord database import vs MySqlImport.
Also related to mapping, Andre recently released GeoKit. GeoKit provides a bundle of tools to make maps-based applications easier:
- Distance calculations in miles or kilometers:
distance = first_location.distance_to(second_location, :units => :miles) - ActiveRecord distance-based finders:
Store.find(:all, :origin=>[37.792,-122.393], :conditions=>'distance < 10') - . . . and directly from an address:
Store.find_closest(:origin=>'100 Spear St, San Francisco, CA') - Geocoding from Google, Yahoo, Geocoder.us, and Geocoder.ca geocoding services. It provides a uniform response structure from all the geocoders, and also has a configurable fail-over mechanism in case one geocoder fails.
- IP-based location lookup. Provide an IP address, and get a city name and latitude/longitude in return.
Andre's announcement on GeoKit is here. Bill Eisenhauer, the co-author of GeoKit, has also put up some live demos. GeoKit's home at RubyForge is http://geokit.rubyforge.org/.

I’d also recommend looking at for google/yahoo maps integration:
http://thepochisuperstarmegashow.com/projects/
ym4r has made my life so easy!!
Looking forward to the this book :-)
Can’t wait!
I’d also like to point out acts_as_geocodable, a plugin that works similarly to GeoKit, but is built on the Graticule geocoding gem.
http://opensoul.org/2007/2/13/geocoding-as-easy-as-1-2
With all the cool stuff you can do with Rails, how about some updated screencasts?
Yeah it will be a good idear to upload some new screencasts. But leave the old ones there because they really show what rails can do !
Ontopic: It looks to be a great book. I`m going to buy it :)
Just ordered the book! Whoopie!
This is really going to go down well. Ajax has changed my life! And this makes it better.
I saw Andre’s talk on REST at the Silicon Valley RoR meetup… It was incredible. This guy is a rising star.
I decided to write a quick google maps mashup… Look for a posting on it soon.
Does anyone know if the rendered google map also displays subway stops (if you look up an address in NYC for instance). I think Google added this feature to maps a few weeks ago but I’m curious if that comes along when you render the map.
FYI: They are having a contest right now to give away 3 copies of this book:
http://googlemapsbook.com/2007/02/26/rails-edition-contest/
It’s open until March 15th 2007.
hi kaushik here ,
good work by apress
slowly1718@weblog.rubyonrails.com