Posts tagged: Google maps

Google Maps in rails 3

By , March 16, 2011 3:08 pm

I already wrote a blog on how to use Google maps in rails.  Earlier blog is supported in rails 2.3.x version.

To supoort rails 3 application , certain changes are required in plugin.

Here I will show you what are those changes required.

Download YM4R plugin :


rails plugin install https://github.com/rorcraft/ym4r_gm

1. Add following method in class Varible under gm_plugin/mapping.rb


def to_str
@variable + “;”
end

2. Use raw method for each google maps methods to avoid html contents.


<%= raw GMap.header %>

<%= raw @map.to_html %>
<%= raw  @map.div(:width => 600, :height => 400) %>

4. Add Ym4r js in your layouts

 <%=javascript_include_tag :defaults,"ym4r-gm"%>

5. Commented line no: 35 in ym4r/lib/gm_plugin/map.rb

#   a << "<script src=\"/public/javascripts/ym4r-gm.js\" type=\"text/javascript\"></script>\n" unless options[:without_js]

I hope this blog helps you. Let me know if you still facing any problem.

Waiting for gg.google.com

By , August 7, 2009 5:09 am

When I was working on Google Maps API , I was getting error of “waiting for gg.google.com” on status bar.

Later on I found out that if script debugging is diabled, this problem can not raise.

So just disable script debugging from the firebug.

Firebug Script Debug

Panorama Theme by Themocracy