Skip to content

Instantly share code, notes, and snippets.

@Andrewglass1
Created June 25, 2012 22:25
Show Gist options
  • Save Andrewglass1/2991769 to your computer and use it in GitHub Desktop.
Save Andrewglass1/2991769 to your computer and use it in GitHub Desktop.
Gmaps.map.createMarker({Lat: lat,
Lng: lng,
rich_marker: null,
marker_picture: ""
});
In my controller:
@json = @deals.to_gmaps4rails do |deal, marker|
marker.infowindow render_to_string(:partial => "/deals/pop", :locals => { :deal => deal})
marker.picture({:color => "http://www.askeachother.com/images/uploads/large/2011-04-03-2713018_Amazon-logo-small.jpg",
:width => 32,
:height => 32})
marker.title "#{deal.merchant.name}"
marker.sidebar "i'm the sidebar"
marker.json({ :revenue => deal.revenue, :ls_merchant => deal.merchant.run_with_ls?,
:provider => deal.provider, :zip => deal.merchant.zip,
:days_since => days_since(deal.date_added) })
end
@gmap_options = {"map_options" => Map.map_options,
"markers" => {"data" => @json,
"options" => Map.marker_options}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment