1

問題を説明する画像は次のとおりです。

ここに画像の説明を入力してください

そのため、 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 />
4

1 に答える 1

1

これは、カートグラファーの問題ではなく、ブートストラップの問題のようです。

https://github.com/twitter/bootstrap/issues/1552

注: 誰かがこれを読んだ場合に備えて、cartographer よりも gmaps4rails をお勧めします。これは、サポートされている新しい gem です。

于 2012-09-25T10:17:52.053 に答える