アプリケーションで gmaps4rails を使用して gmaps を表示しています。マップ ポイントを正しく取得していますが、マップ内の現在の場所と別の場所を区別できません。次の方法で 2 つの場所に異なるマーカーを使用することを考えていますが、私のために働いていませんでした
私のコントローラー
def profile
@googlemaplocation=Location.find_by_id("#{params[:clinic_id]}")
@json1 = @googlemaplocation.to_gmaps4rails do |locations, marker|
marker.picture({
:picture => "http://www.google.com/mapfiles/dd-start.png",
:width => 32,
:height => 32
})
end
@neargooglemaplocation=@googlemaplocation.nearbys(10)
@json2= @neargooglemaplocation.to_gmaps4rails do |locations, marker|
marker.picture({
:picture => "http://www.google.com/mapfiles/dd-start.png",
:width => 32,
:height => 32
})
end
@json = (JSON.parse(@json1) + JSON.parse(@json2)).to_json
end
私の見解
<%= gmaps(:markers => { :data => @json } ) %>
同じマップに 2 つの異なるマーカーを表示したい場合はどうすればよいですか
ありがとう & よろしく ハリ・クリシュナ