开发者

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开发者_如何学JAVA a custom marker picture? or add some css to it? to all my marker pictures? I found it ugly doing this with shadow picture.


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; 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜