« August 2006 | Main | October 2006 »
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 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
Cartographer and YM4R definitely provide some food for thought. If you're doing serious map-based development, you have a choice to make: do you want to program directly in JavaScript (the native tongue of all the web-based mapping APIs), or do you want an a Ruby-based intermediary package (as these two projects provide). There are pros and cons to both approaches, and I think the answer will depend on the kind of project you're doing. I'll write more on this in a future post.