Description

class Gmaps4rails::MarkersBuilder

the to_gmaps4rails method accepts a block to customize:

  • infowindow

  • picture

  • shadow

  • title

  • sidebar

  • json

This works this way:

@users = User.all
@json  = Gmaps4rails.build_markers @users do |user, marker|
  marker.lat user.latitude
  marker.lng user.longitude
  marker.infowindow render_to_string(:partial => "/users/my_template", :locals => { :object => user}).gsub(/\n/, '').gsub(/"/, '\"')
  marker.picture({
                  :url    => "http://www.blankdots.com/img/github-32x32.png",
                  :width  => "32",
                  :height => "32"
                 })
  marker.title   "i'm the title"
  marker.json({ :id => user.id })
end

Returns a new instance of MarkersBuilder

MarkersBuilder is referenced in 0 repositories