将 gmaps4rails v1 迁移到 v2(伟大的宝石!)。但我不能只获得默认的自定义标记图像。
输出代码:
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
markers = handler.addMarkers([{"lat":43.3851,"lng":12.3856,"picture":{"picture":"/assets/house.png","width":"32","height":"32"},"title":"blablabla"}
控制器
@locations = Location.where(:region => @region.id)
@hash = Gmaps4rails.build_markers(@locations) do |location, marker|
marker.lat location.latitude
marker.lng location.longitude
marker.infowindow location.description
marker.picture({
"picture" => "/assets/house.png",
"width" => "32",
"height" => "32"
})
marker.json({:title => location.description})
end
如果您查看输出,则代码有效……但我没有看到自定义标记 house.png。
我在这里做错了吗?安全问题?
谢谢..remco