如何在gmaps4rails中更改地图样式

时间:2012-09-29 15:04:21

标签: ruby-on-rails styles gmaps4rails

我正在使用gmaps4rails,并想知道是否有办法在gmaps4rails中更改地图样式(功能,颜色等)。我必须使用json吗?

谢谢,

1 个答案:

答案 0 :(得分:0)

<%= gmaps( :map_options => {:raw => "{styles: myStyle}" }, 
           :markers     => { "data" => @json, "options" => {"draggable" => true, "list_container" => "markers_list" } }) %>

<script type="text/javascript" charset="utf-8">
var myStyle = [ 
  { featureType: "all", stylers: [{ "hue": "#ff1a00" } ]} 
];
</script>