Is it possible to make marker list with gmaps4rails similiar to google maps?
I want to make something like that:
I have found option to declare list:
https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers
But I don't know how to add to each marker upcase character(ie A, B, C).
It cannot be direct. You should:
Create a mapping between your set of objects and a letter (one id => one letter).
use this mapping to create the proper text in the list
import a list of markers with letters and pick the right one according to your mapping
Edit:
In your model:
attr_accessor :number
def gmaps4rails_sidebar
"#{number}: whatever text you need"
end
def gmaps4rails_marker_picture
# set picture depending on number
end
In your controller:
@users = User.all
@users.each_with_index do |user,index|
user.number = index
end
@json = @users.to_gmaps4rails