Ruby on Rails Wednesday, October 30, 2013

i am using google maps for my project in rails 4, ruby 2, and
gmaps4rails '1.5.6' but the problem is i am not getting marker at center
of the map as well as the zoom in zoom out side bar is also not coming.

If any one have any idea about this problem please reply?

Model Action
acts_as_gmappable

def gmaps4rails_address
html = full_address(city_id,state_id,country_id)
self.location = (location + html)
location
end

def full_address(city_id,state_id,country_id)
city_name = MdmCity.get_city_name(city_id)
state_name = MdmState.get_state_name(state_id)
country_name = MdmCountry.get_country_name(country_id)
html = "#{city_name} #{state_name} #{country_name}"
html
end

Controller Action

def edit_content
@location_json = SeoContent.where(:id =>
params[:id]).first.to_gmaps4rails
end

VIEW

<%= gmaps4rails(@location_json) %>

Issues for me.
1) Zoom In and Zoom out bar is not coming.
2) Marker is not coming at center.
3) How to give Info window.
4) How to raise that address is Invalid, which is not present on google
map (Eg:kdjfkdfhdkfhd)
5) Why this action (def gmaps4rails_address) is calling automatically.
6) I want to call def gmaps4rails_address from update action too how ?
7) Map is coming only one forth ?why
8) Can i show directions on map ?

Thanks

Attachments:
http://www.ruby-forum.com/attachment/8878/gmap.png


--
Posted via http://www.ruby-forum.com/.

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/43f91518a7282838c0e07c9f6003d04f%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment