問題を説明する画像は次のとおりです。
そのため、 https://github.com/parolkar/cartographer(この段階ではプラグインとしてのみ利用可能)を使用しており、上記のような異常なマップレンダリングを取得しています。アイコンの位置などはすべて問題ないように見えますが、アイコンをクリックすると、ファンキーな情報ボックス(正しい情報が表示されます)が表示されます。
マップと情報ボックスを生成するために使用しているコードは次のとおりです。
@map = Cartographer::Gmap.new( 'map')
@map.zoom = :bound
@icon = Cartographer::Gicon.new()
@map.icons << @icon
@count = 0
@numrecords.times do
markername = "marker#{@count}"
markername = Cartographer::Gmarker.new(:name=> "Business#{@count}", :marker_type => "Building",
:position => [@lat[@count], @long[@count]],
:info_window_url => "/bio/#{@branch_id[@count]}", :icon => @icon)
@map.markers << markername
@count += 1
end
コントローラからも:
def bio
@branch = Branch.find(params[:id])
render :layout => false
end
およびバイオビューファイル
<%= link_to "#{@branch.name}", branch_path %><br />
<%= @branch.business.name %><br />