apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

Setting marker picture in view not working #203

Closed novito closed 12 years ago

novito commented 12 years ago

I have a simple application to test this awesome gem and it's as simple as:

https://github.com/novito/maps4rails

When trying to add the picture of the marker in the view, by doing:

<%= gmaps("markers" => {"data" => @markers, "options" => { "marker_picture" => "assets/prova.png"}}) %>

That picture is not rendered. Even though in the source I can see this:

Gmaps.map.markers = [ {"description": "", "title": "", "sidebar": "", "lng": "-122.345467", "lat": "37.568749", "picture": "", "width": "", "height": ""} ]; Gmaps.map.markers_conf.marker_picture = "assets/prova.png";

So, I have tried looking into the code, but I fail to see where is that being set...

apneadiving commented 12 years ago

See doc: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers

novito commented 12 years ago

I have checked that doc, and it's this line that I have followed:

<%= gmaps("markers" => { "data" => @markers, "options" => { "marker_picture" => your_pic, "marker_width" => 22, "marker_length" => 32 } }) %>

However, this doesn't make the picture to show up. It defaults to the google maps default one.

apneadiving commented 12 years ago

Ok, will dig this later. Which version do you use?

novito commented 12 years ago

1.4.8

On Thu, May 3, 2012 at 4:44 PM, Benjamin Roth < reply@reply.github.com

wrote:

Ok, will dig this later. Which version do you use?


Reply to this email directly or view it on GitHub:

https://github.com/apneadiving/Google-Maps-for-Rails/issues/203#issuecomment-5501320

Joan Roig Arderiu roigarderiu@gmail.com Torrelles de Llobregat (Barcelona) Catalunya

apneadiving commented 12 years ago

Ok thanks, doc wasn't updated...

Simply do :

    <%= gmaps("markers" => { "data" => @markers, "options" => { "picture" => your_pic, "width" => 22, "length" => 32 } }) %>
novito commented 12 years ago

Sure. Thank you for this awesome gem.