views:

326

answers:

1

Hi,

Has anyone got any suggestions on where to start with building a google map into a rails app? I would like users to be able to add a marker by clicking the map, and have spent a few days looking for a suitable tutorial or plugin (beyond ym4r), to little avail...any help would be much appreciated as I am finding the Google Maps API rather difficult to get into! I've also come across the railskit for google maps - does anyone have any experience in using it?

A: 

I probably wouldn't use YM4R. We tried it and found that it doesn't add much value because it just wraps the API. I would recommend working with Google Maps directly from JavaScript. Google Maps API documentation is pretty good, and there are quite a few examples on the web.

There is an example of a click handler on the map here, and adding a marker is just a matter of doing

map.addOverlay(new GMarker(latlng));
Alex - Aotea Studios
Cheers! Any reason to favour GMaps V2 over V3?
Sonia
@Sonia: You should use version 3 actually, I've just checked and it's become the official version. When I was using the API a few months ago, V3 was incomplete, so I just grabbed a V2 link.
Alex - Aotea Studios
v2 is oficially deprecated now. Few minutes v2 broke along. It still work with minor fix, but its the best sign to move away to v3.
mdrozdziel