Pregunta

gmaps4rails 2 + rails 4

def CommonUtils.get_gmap_hash(object)
     Gmaps4rails.build_markers(object) do |user, marker|
         marker.lat user.latitude
         marker.lng user.longitude
         marker.infowindow user.location
         binding.pry
         marker.picture({
            :picture => "/img/blank.png",
            :width   => 32,
            :height  => 32
            })
         marker.json({:title => user.title})
      end
  end

here marker.picture method is not hitting itself don't know why ? Any help ?

and default marker is coming i want different marker(blank.png).

blank.png is in assets/images/img/blank.png

¿Fue útil?

Solución

According to the source, do:

 Gmaps4rails.build_markers(object) do |user, marker|
     marker.lat user.latitude
     marker.lng user.longitude
     marker.infowindow user.location
     marker.picture({
        :url     => "/img/blank.png",
        :width   => 32,
        :height  => 32
        })
     marker.json({:title => user.title})
  end
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top