gmaps4rails:如何为路线图设置地图选项,例如容器ID?

时间:2011-11-16 17:39:57

标签: ruby-on-rails ruby-on-rails-3 gmaps4rails

我一直试图为路线图设置我的容器类和id选项而没有任何成功......有谁知道如何?

来自文档:

<%= gmaps( :map_options => { :container_class => "foo", :id => "bar", :class => "baz" } %>

<%= gmaps({"direction" => { "data" => { "from" => "Paris, france", "to" => "Toulon, france" } }})
 %>

我尝试将两者结合起来,但它不起作用......

干杯,

乔尔

1 个答案:

答案 0 :(得分:5)

您只需要一张地图吗?

在这种情况下:

<%= gmaps( :map_options => { :container_class => "foo", :id => "bar", :class => "baz" },
           "direction" => { "data" => { "from" => "Paris, france", "to" => "Toulon, france" }}
) %>