2011-08-27 69 views
2

失败足以问另外一个问题:使用 如何为RichMarker设置偏移量?

  • gmaps4rails v0.11.1 - 伟大的宝石!
  • RichMarker

托管平坦使用:marker_anchor => [10, true]

使标记但我有上的标记的底部的箭头,所以如何设置一个marker`s HTML(RichMarker)的偏移是放在哪里?

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

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

回答

4

看一看在标记部维基:

"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,真]' 表示偏移。

看一看我提供的链接:Richmarker的偏移不与像素表达,但都是整数的意思TOP_LEFT等等

如果您需要精确的偏移,保持你的CSS!

+0

有一个问题:RichMarkers的DIV是从谷歌地图包裹woith另一个div,并且当我设置偏移制造商然后父母留在地方。 8((( – prikha

相关问题