无法提出另一个问题: 使用
- gmaps4rails v0.11.1 - 很棒的 gem !
- RichMarker
使用 :marker_anchor => [10, true] 设法使标记变平
但是我在标记的底部有一个箭头,那么如何设置要放置的标记的 html(RichMarker) 的偏移量?
现在是通过在 richmarker html 中为 div 设置 css 偏移量来完成的。但这似乎有点奇怪。
是否可以使用 Gmaps4rails 方法设置偏移量?
最佳答案
查看 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!
关于ruby-on-rails - 如何设置 RichMarker 的偏移量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7216197/