Monday, September 28, 2009

Google Map With Ruby On Rails Application

In this post i like to describe integration of the google map with the ruby on rails application. Most of the time for our projects ,we have to use google map for find a place,mark some important locations ect..

Mark a location in a google map

Google map API is totally javascript. So convert to java script variable in to Ruby variable little bit difficult. So i use a trick for make life easy. Trick was i placed a hidden fields for both' lag' and 'lat'.And get those variables as 'params' when submit the form

Find Mark Locations

It is easy.You want to get lng and lat values from your database and Simlpy can disply by Using following code

For more informtaion- http://code.google.com/apis/maps/

No comments:

Post a Comment