2011-08-27 102 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

相關問題