Googleマップをレール用に使用していますが、設定はすべて適切ですが、デフォルトのズーム番号を設定する方法はわかりません。Google Maps for Rails - センター上のマーカーは常に最大ズーム
@default_map_options =
id: 'map'
draggable: true
detect_location: false # should the browser attempt to use geolocation detection features of HTML5?
center_on_user: false # centers map on the location detected through the browser
center_latitude: 0
center_longitude: 0
zoom: 7
maxZoom: null
minZoom: null
auto_adjust : true # adjust the map to the markers if set to true
auto_zoom: true # zoom given by auto-adjust
bounds: [] # adjust map to these limits. Should be [{"lat": , "lng": }]
raw: {} # raw json to pass additional options
しかし、私はそれが正常に働いていたと思ういけない:私はここgmaps4rails.base.js.coffeeでそれを設定してみました。マップを作成するときにズーム番号を追加する方法はあります:私は
<%= gmaps(:markers => {:data => @json,
:options => {:raw => '{ animation: google.maps.Animation }' } },
:map_options => { :raw => '{ disableDefaultUI: false,
scrollwheel: true }' }) %>
何も何もしていないようにみえ、それはいつものおかげですべての方法をズームしています。!
自動ズームを試してください:あなたのオプションで偽 –
私はそれを試みました。それは何も変わらなかった。私も私のサーバーを再起動しようとしました。これらのオプションは変更していないようです –
本当に理解できません:地図上にマーカーがありますか?どれも、1つ、または多く? – apneadiving