prikha
prikha

Reputation: 1853

Marker styling in Gmaps4Rails

Is it possible to do something like this marker styling using Gmaps4rails gem. I`ve managed to get by with InfoBox, but it was written in the wiki

How could I add some border for a custom marker picture? or add some css to it? to all my marker pictures? I found it ugly doing this with shadow picture.

Upvotes: 3

Views: 1615

Answers (1)

apneadiving
apneadiving

Reputation: 115511

Just added this to the gem. Available on github now (doc updated as well, same link as marker styling).

Will be included in 0.11.1

In short:

def gmaps4rails_marker_picture
  {
  "rich_marker" => "<div class='my-marker'>It works!<img height='30' width='30' src='http://farm4.static.flickr.com/3212/3012579547_097e27ced9_m.jpg'/></div>"
  }
end

With the proper css:

.my-marker {
  background-color: red;
  width: 30px;
  height: 50px;
  padding: 5px;
  font: 10% "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; 
}

Upvotes: 9

Related Questions