Quick summary: I've got some code here that should let you pretty easily add custom google maps to your rails app. It's far from complete but it's enough to get you going.
It's based on work from
Anselm Hook (who looks
like this), which was based on work from Phil at
mygmaps.com, which of course is based on
Google Maps which has a copyright notice like every two lines in their obfuscated javascript code. Phil, Anselm and I are all open source for the community types but don't even try asking me about licensing, we're probably all going to hell. Come on in, the water's warm.
I started with Anselm who had taken cues from Phils work to get a
Drupal-ized version working for
CivicMaps.org. He had
posted some samples, which were a bit screwy at first but he worked with me to get a cleaned up version that comes down to three files:
inner.html,
data.xml and
xform.xsl. The idea is that inner.html would be included in another html file like this:
<iframe src="http://myhost.com/inner.html" width="600" height="400" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" ></iframe>
but for testing you can just load inner.html directly.
You should be able to drop all three files into a directory on your web server, edit the xml to make sure it's pointing to the right place for the xsl and the icon pngs, edit the html to make sure it's pointed in the right place for the xml, and then load inner.html in your browser. You can figure it out from there.
So what I did was take this and replace the need for a data.xml file with the ability to create the pinpoint xml dynamically in a Ruby on Rails application. You can try it out by downloading this
GMoR.zip file and unzipping it in your rails application directory. It should create the following files (you should make sure you didn't happen to have anything of the same name that would get overwritten):
app/views/gmap/gmap.rhtml
app/views/gmap/inner.rhtml
app/controllers/gmap_controller.rb
app/helpers/gmap_helper.rb
lib/GmapLocation.rb
lib/GmapMap.rb
public/man.png
public/xform.xsl
To see the default map, just load http://yourrailsbox.com:3000/gmap/gmap (if you're using WebBrick anyhow).
To make your own map, edit gmap.rhtml to change the properties of the GmapMap and GmalLocation objects created there.
I just got all this working, so I'm sure there's bugs. I wanted to post it anyhow though, since I'm not sure when I'll have time to play with it more. I suppose if it were cleaned up it would be good to make it a gem-installed generator. Maybe some day.