How do pass color parameter to google maps api using google-maps-for-rails? I would like to set color of each marker inside controller based on a value, so some would be red, some yellow and some green. I believe it is the icon property, in Symbol, looking at:
https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions
Also, I would like to have a number from 1-99 inside the marker, is it possible? So far I have this.
@json = Device.all.to_gmaps4rails do |device, marker|
end
I have been struggling with this for days, any help would be appreciated.
You should simply leverage the google’s chart api.
Example, the following is a marker with:
FF0000000000http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000
So you should customize your needs: