I've come across two projects which aim to simplify the map creation process for us Rails users: Cartographer and YM4R. Cartographer has been around longer (according to Rubyforge), but YM4R is more mature and full-featured. YM4R is also under more active use and development; it's currently ranked #264 in Rubyforge.
Cartographer gives you helpers to easily create Google Maps and add markers to it. The project recently went through a major revision for compatability with the Google Maps API version 2, and unfortunately the documentation hasn't been updated in step. The project includes code for geocoding via both Geocoder.us and Ontok (a geocoder which I haven't encountered before). Something which looks good in the code is an abstraction layer for the Google Maps key -- it will let you specify different GMaps keys for different combinations of hosts/controllers/actions.
Next up is YM4R. YM4R packs a lot of functionality for both Google Maps and Yahoo maps (via the Mapstraction library). The project is broken into four parts:
- The YM4R/GM plugin for Rails provides helpers for interacting with the main Google Maps API. It is engineered to facilitate updates to the map via RJS. The plugin also includes some functionality not directly available through the GMaps API: Clusterer, GeoRSS, WMS layer. Read up in the documentation do see if these extensions are useful for your project.
- The YM4R/Mapstraction plugin for Rails provides rails helpers to interact with the Mapstraction API. As with YM4R, it facilitates updates to the maps via RJS.
- The YM4R gem provides ruby helpers for the Google Maps geocoding API and the Yahoo! Maps Building Block API’s: Geocoding, Traffic, Map Image and Local Search v3. The gem plugs into both Yahoo and Google geocoders, but not any 3rd party geocoders like geocoder.us.
- The Tools package provides command-line tools to generate tiles in order to create custom map types for use in Google Maps.
The YM4R author has been posting regular updates and tutorials on using the packages, so there's a lot of information available. He has the RDocs for all the packages online as well.
The Tools package for custom tiles is interesting. Read through the docs at http://thepochisuperstarmegashow.com/ProjectsDoc/ym4r_tools-doc/ and check out an example of the result at http://open.atlas.free.fr/GMapsTransparenciesImgOver.php
Helpers or no Helpers?
- Mapstraction is an intermediary library which aims to abstract out the differences among GMaps, Yahoo maps, and Microsoft Virtural Earth. The above-mentioned YM4R/Mapstraction plugin utilizes the Mapstraction code. Mapstraction currently talks to v2 Google, v3 Yahoo and v2 VE.
- Google Maps API
- Basic Rails, Geocoding, and Google Maps howto