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
on 2013-02-11 11:25
on 2013-02-11 16:18
On 11 February 2013 10:25, honey ruby <emailtohoneyruby@gmail.com> wrote: > 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. Can you give more detail? Show us exactly which call you are making and what the parameters are and what result you get. Colin
on 2013-02-13 06:42
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.