当我尝试使用自定义的marker.picture
.
此代码完美运行:
显示常规 GoogleMaps Pin(红色)。如果我单击 Pin,信息窗口将打开。
@hash = Gmaps4rails.build_markers(@nearbys) do |location, marker|
marker.title location[:name]
marker.lat location[:coordinates].y
marker.lng location[:coordinates].x
marker.json({title: location[:name]})
end
当我添加marker.picture
图像时显示。但它不再是可点击的。
@hash = Gmaps4rails.build_markers(@nearbys) do |location, marker|
marker.title location[:name]
marker.lat location[:coordinates].y
marker.lng location[:coordinates].x
marker.json({title: location[:name]})
marker.picture({
marker_anchor: [40, 58], # added this optionally <- doesn't work either
url: "#{view_context.image_path("map/icons/3dmarker.png") }",
width: "44",
height: "58"
})
end
有什么建议我做错了吗?
先感谢您