Search code examples
ruby-on-railscssgoogle-mapscanvasgmaps4rails

Google maps marker show just one quarter of it


I am working with gmaps4rails gem, and when generating the map, I get this weird behavior in the markers:

Quarter marker

As you can see the marker shows just one part of it, and I don't understand why. If I use the default pin, the marker is shown correctly.

How can I know which CSS is the marker/map using? Or, any thoughts how can I solve this?

You can see it live here: Gmaps borked


Solution

  • You're missing the width-and height-properties for the marker-setup.

    Use this:

    {"description": "", 
     "title": "", 
     "sidebar": "", 
     "lng": "-122.345467", 
     "lat": "37.568749", 
     "picture": "assets/prova.png", 
     "width": 70, 
     "height": 88}
    

    also add a marker_anchor-member to the setup to keep the marker pinned at the correct position:

    "marker_anchor":[23,78]