Google-Maps-for-Rails

103 views
Skip to first unread message

honey ruby

unread,
Feb 11, 2013, 5:25:03 AM2/11/13
to rubyonra...@googlegroups.com
Hey all,
 

I am using google maps for rails gem. When I use this It is going with location not specific. Let say I am looking for a store location in Houston in Tx . The issue is, it is not locating exact store rather it is just locating only Huston. Can any one help me what to do.





Thanks in advance,
Honey

honey ruby

unread,
Feb 11, 2013, 10:14:01 AM2/11/13
to rubyonra...@googlegroups.com
I used google_maps_for_rails gem.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/UVvK-DCLirEJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Colin Law

unread,
Feb 11, 2013, 10:16:25 AM2/11/13
to rubyonra...@googlegroups.com
Can you give more detail? Show us exactly which call you are making
and what the parameters are and what result you get.

Colin

honey ruby

unread,
Feb 13, 2013, 12:41:24 AM2/13/13
to rubyonra...@googlegroups.com
This is code I have written

def index
    @cities = City.all
    @json = City.all.to_gmaps4rails

 
       respond_to do |format|
      format.html # index.html.erb
      format.json { render :json=> @cities }
    end
  end

  def create
    @city = City.new(params[:city])

    respond_to do |format|
      if @city.save
        format.html { redirect_to @city, :notice => 'City was successfully created.' }
        format.json { render :json=> @city, :status => :created, :location => @city }
      else
        format.html { render :action => "new" }
        format.json { render :json=> @city.errors, :status => :unprocessable_entity }
      end
    end
  end

 Index view

<%= gmaps4rails(@json) %>

My Input is

Name: Spencer

State: Musheerabad

Latitude: 17.4157

Longitude: 78.4993

I got above result to my inputs but it did  not locate exactly.

When I gave same Inputs using another app which

http://electric-sunrise-8410.heroku.com/locations/new


In this link he used direct google api. not gem.

Latitude: 17.412577

Longitude: 78.49859200000003

The above are the exact location what I want.

This is the issue I am facing with this gem. As the above link was more specific with address.

Reply all
Reply to author
Forward
0 new messages