2

未能提出另一个问题:使用

  • gmaps4rails v0.11.1 - 很棒的宝石!
  • 丰富的标记

设法使标记变平使用:marker_anchor => [10, true]

但是我在标记的底部有一个箭头,那么如何为要放置的标记的 html(RichMarker) 设置偏移量?

现在它是通过在richmarker html 中为一个div 设置一个css 偏移量来完成的。但这似乎有点奇怪。

是否可以使用 Gmaps4rails 方法设置偏移量?

4

1 回答 1

4

查看标记部分中的 wiki:

"rich_marker" =>   ,   # html, facultative
                        # If used, all other attributes skipped except "marker_anchor". This array is used as follows:
                        # [ anchor , flat ] : flat is a boolean, anchor is an int. 
                        # See doc here: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/docs/reference.html 

所以基本上,'marker_anchor => [10, true]' 的第一个元素代表偏移量。

看看我提供的链接:Richmarker 的偏移量不是用像素表示的,而是表示 TOP_LEFT 等的整数......

如果您想要精确的偏移量,请保留您的 CSS!

于 2011-08-28T06:30:26.263 回答