Get lng and lat from Google maps

23 views
Skip to first unread message

Mohammed Alenazi

unread,
Mar 16, 2010, 10:45:49 PM3/16/10
to Ruby on Rails: Talk
Hi

I am trying to have a google map where the user can click on the map
and choose a location. After that, I need to save the lng and lat
chosen by the user from the map into the database using rails. What
would be the best way to approach that?

Brijesh Shah

unread,
Mar 17, 2010, 4:32:50 AM3/17/10
to rubyonra...@googlegroups.com
Use event_id method

@map.event_init(@map, :click,
"function(marker,point) { alert(point);
}")

point will give u lat long information.


For information about google maps in rails:
http://blog.brijeshshah.com/google-maps-in-ruby-on-rails/


Thanks
Brijesh Shah
--
Posted via http://www.ruby-forum.com/.

Reply all
Reply to author
Forward
0 new messages