rubyonrailsworld-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2013-Jan-15 17:50 UTC
how to show different markers for current location and nearby locations in gmaps4rails
Hai guys, Iam using gmaps4rails to show gmaps in my application.iam getting the map pointa right but iam unable to differentiate the current location and nerby locations in my map.my idea is to use different markers for two locations i did it in the following way but it didnt worked for me my controller def profile @googlemaplocation=Location.find_by_id("#{params[:clinic_id]}") @json1 = @googlemaplocation.to_gmaps4rails do |locations, marker| marker.picture({ :picture => "http://www.google.com/mapfiles/dd-start.png", :width => 32, :height => 32 }) end @neargooglemaplocation=@googlemaplocation.nearbys(10) @json2= @neargooglemaplocation.to_gmaps4rails do |locations, marker| marker.picture({ :picture => "http://www.google.com/mapfiles/dd-start.png", :width => 32, :height => 32 }) end @json = (JSON.parse(@json1) + JSON.parse(@json2)).to_json end my view <%= gmaps(:markers => { :data => @json } ) %> what should i do if i want to display two different markers on the same map Thanks & Regards Hari Krishna -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/igsmuF6_gmYJ. For more options, visit https://groups.google.com/groups/opt_out.
rubyonrailsworld-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2013-Jan-16 11:41 UTC
how to show different markers for current location and nearby locations in gmaps4rails
Hai guys, Iam using gmaps4rails to show gmaps in my application.iam getting the map pointa right but iam unable to differentiate the current location and nerby locations in my map.my idea is to use different markers for two locations i did it in the following way but it didnt worked for me my controller def profile @googlemaplocation=Location. find_by_id("#{params[:clinic_id]}") @json1 = @googlemaplocation.to_gmaps4rails do |locations, marker| marker.picture({ :picture => "http://www.google.com/mapfiles/dd-start.png", :width => 32, :height => 32 }) end @neargooglemaplocation=@googlemaplocation.nearbys(10) @json2= @neargooglemaplocation.to_gmaps4rails do |locations, marker| marker.picture({ :picture => "http://www.google.com/mapfiles/dd-start.png", :width => 32, :height => 32 }) end @json = (JSON.parse(@json1) + JSON.parse(@json2)).to_json end my view <%= gmaps(:markers => { :data => @json } ) %> what should i do if i want to display two different markers on the same map Thanks & Regards Hari Krishna -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/15AQjwYNpjcJ. For more options, visit https://groups.google.com/groups/opt_out.
hari krishna
2013-Jan-17 05:09 UTC
how to show different markers for current location and nearby locations in gmaps4rails
Hai guys, Iam using gmaps4rails to show gmaps in my application.iam getting the map pointa right but iam unable to differentiate the current location and nerby locations in my map.my idea is to use different markers for two locations i did it in the following way but it didnt worked for me my controller def profile @googlemaplocation=Location.find_by_id("#{params[:clinic_id]}") @json1 = @googlemaplocation.to_gmaps4rails do |locations, marker| marker.picture({ :picture => "http://www.google.com/mapfiles/dd-start.png", :width => 32, :height => 32 }) end @neargooglemaplocation=@googlemaplocation.nearbys(10) @json2= @neargooglemaplocation.to_gmaps4rails do |locations, marker| marker.picture({ :picture => "http://www.google.com/mapfiles/dd-start.png", :width => 32, :height => 32 }) end @json = (JSON.parse(@json1) + JSON.parse(@json2)).to_json end my view <%= gmaps(:markers => { :data => @json } ) %> what should i do if i want to display two different markers on the same map Thanks & Regards Hari Krishna -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2013-Jan-17 08:45 UTC
Re: how to show different markers for current location and nearby locations in gmaps4rails
On 17 January 2013 05:09, hari krishna <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hai guys, > > Iam using gmaps4rails to show gmaps in my application.iam getting the > map pointa right but iam unable to differentiate the current location > and nerby locations in my map.my idea is to use different markers for > two locations i did it in the following way but it didnt worked for meIt seems this is the third time that you have asked this in as many days. The fact that no-one has replied probably means no-one knows the answer. There is no point just asking the same question again and again. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.