gmaps4rails单标记自动缩放

我想在地图上显示单个标记时,按照此处的答案缩小一点(默认情况下)。 我已经尝试了下面的代码,并生成了一个工作图,但更改setZoom没有任何效果。 此外,我从firebug收到以下错误(代码下方)。

 {"data" => @json, "options" => {"auto_zoom" => false} }) %>   function gmaps4rails_callback() { if (Gmaps4Rails.markers.length == 1) { //only one marker, choose the zoom level you expect Gmaps4Rails.map.setZoom(5); } else{ //more than one marker, let's auto_zoom Gmaps4Rails.map_options.auto_zoom = true; Gmaps4Rails.adjust_map_to_bounds(); } }   

唯一的错误是:

 TypeError: Yc is not a function [Break On This Error] ...=b}Rf[F].Fa=xk(7,Yc("f"));me[F].cb=xk(3,function(a){var b;if(b=a.ca[ec]()?j:a.ca... 

好吧,自从我发布你引用的答案后,界面发生了很大变化。

 <%= gmaps("markers" => {"data" => @json, "options" => {"auto_zoom" => false} }) %> <% content_for :scripts do %>  <% end %>