I have an application that has a location model geocoded by the address entered by the user, right now Im showing the google map given the address geocoded in the location instance, now what I want to do is show the foursquare venues with its icons in the map that shows the location instance, how could I achieve this, Im already getting the nearby venues in a list, how can I show them in the map with its icon.
This is the show view and controller in which I want to see the map with the location instance plus the foursquare venues nearby...
def show
@location = Location.find(params[:id])
@json = Location.where('slug = ?', params[:id]).to_gmaps4rails
end
The view:
<% provide(:title, @location.name) %>
<% if !@location.active? %>
<%= content_tag(:div, "Location currently deactivated!", class: "alert") %>
<% end %>
<div class="row-fluid">
<aside class="span4" >
<section>
<h1>
<%= @location.name %>
</h1>
<%= gmaps({
"map_options" => { "auto_zoom" => false, "zoom" => 17 },
"markers" => { "data" => @json }
}) %>
</section>
</aside>
</div>
Thank you for your help!