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/.

Posted in Documentation, Sightings | 13 comments

Comments

  1. jonnii on 16 Feb 19:12:

    I’d also recommend looking at for google/yahoo maps integration:

    http://thepochisuperstarmegashow.com/projects/

    ym4r has made my life so easy!!

  2. Johannes de Jong on 16 Feb 19:26:

    Looking forward to the this book :-)

  3. Jeffrey Hicks on 16 Feb 21:18:

    Can’t wait!

  4. Brandon Keepers on 16 Feb 22:27:
    • shameless plug *

    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

  5. not complaining on 18 Feb 00:18:

    With all the cool stuff you can do with Rails, how about some updated screencasts?

  6. Hurry on 19 Feb 09:44:

    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 :)

  7. Second Life Addict on 20 Feb 11:27:

    Just ordered the book! Whoopie!

  8. Trudie Bellamy on 20 Feb 16:17:

    This is really going to go down well. Ajax has changed my life! And this makes it better.

  9. anonumus on 20 Feb 19:09:

    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.

  10. anon2 on 23 Feb 06:05:

    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.

  11. Cam Turner on 27 Feb 15:33:

    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.

  12. think22act@yahoo.com on 06 Apr 18:04:

    hi kaushik here ,

    good work by apress

  13. in3548@weblog.rubyonrails.com Content-Transfer-Encoding: quoted-printable Content-Type: text/html on 18 Apr 14:15:

    slowly1718@weblog.rubyonrails.com