Controller.rb
Rails 4.0 + gmaps4rails 2.0.3 + ruby 2.0.0
Googleマップのマーカー画像を変更したい。「画像」=>「http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000」を与えている場合、誰かがどうすればよいか考えていれば何も来ませんか? 共有してください
ありがとう
Gmaps4rails.build_markers(object) do |user, marker|
marker.lat user.latitude
marker.lng user.longitude
marker.infowindow user.location
marker.picture({
"picture" => 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000',
"width" => '16',
"height" => '16'
})
marker.json({:title => user.title})
end
私はこれも試していますが、別のマーカーがどこに間違っているのかわかりませんか?
def CommonUtils.get_gmap_city_marker(object)
Gmaps4rails.build_markers(object) do |user, marker|
marker.lat user.latitude
marker.lng user.longitude
marker.infowindow user.location
marker.picture({
:picture => "http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000", # up to you to pass the proper parameters in the url, I guess with a method from device
:width => 32,
:height => 32
})
marker.json({:title => user.title})
end
end