2009年4月3日 星期五

ym4r memo (1)

ym4r in github
1. 如果你的website 會用到不同的domain 時, 就需要在設定裡面特別去指定各個host 的key, 然後在GMap.header 裡, 加上:host 的參數, 如
you may need to have multiple keys
(for example if your app will be accessible from multiple URLs, for which you need different keys), you can also associate a hash to the environment, whose keys will be the different hosts. In this case, you will need to pass a value to the :host key when calling the method GMap.header(usually @request.host.



2. 也可以一次用兩張地圖, 不過你這時你就必須特別指定global variable

另一個在controller 必要的設定是設定地圖中心和 zoom



3. to_html 可以傳 :full => true 來讓它變全螢幕



4. GMarker 可以吃很多種參數
You can pass options to the GMarker to customize the info window (:info_window or :info_window_tabs options), the tooltip (:title option) or the icon used (:icon option).

For example:


5. GPolyline
GPolylines are colored lines on the map. The constructor takes as argument a list of GLatLng or a list of 2-element
arrays, which will be transformed into GLatLng for you. It can also take the color (in the #rrggbb form), the
weight (an integer) and the opacity. These arguments are optional though.

For example:


6. GPolygon
The constructor takes as argument a list of GLatLng or a list of 2-element arrays, which will be transformed into GLatLng for you. Note that for polygons, the last point must be equal to the first, in order to have a closed loop. It can also take the color (in the #rrggbb form) of the stroke, the weight of the stroke, the opacity of the stroke, as well as the color of the fill and the opacity. These arguments are optional though.

For example:

沒有留言: