Search code examples
ruby-on-railsgoogle-mapsgmaps4rails

image attribute to a temporary marker in gmaps4rails


I am trying to add a different pin image to client side marker. I tried Icon: and picture: (the same way pictures are assigned in the controller side) but non of them seem to work

var tempmarker = {lat: lat, lng: lng, "infowindow":"hello:, picture:"assets/pin.png"}

I tried to find more information in the gmaps4rails docs but could not find any list of attributes.

Thank you


Solution

  • Sample of expected json:

    {
    "lat":50.8503396,
    "lng":4.3517103,
    "picture":
      {
       "url":"/logo.png",
       "width":32,
       "height":32
      },
    "infowindow":"Bar"
    }
    

    Source code is pretty clear.