Skip to content

Commit

Permalink
Class option in GMap#div
Browse files Browse the repository at this point in the history
git-svn-id: http://ym4r.rubyforge.org/svn/Plugins/GM/trunk/ym4r_gm@79 c9bc9743-7714-0410-b404-d8b1d4e1ace9
  • Loading branch information
Guilhem Vellut committed Jan 21, 2007
1 parent 6e6ecf6 commit 8ad3eae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/gm_plugin/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ def self.header(options = {})
a
end

#Outputs the <div id=...></div> which has been configured to contain the map. You can pass <tt>:width</tt> and <tt>:height</tt> as options to output this in the style attribute of the DIV element (you could also achieve the same effect by putting the dimension info into a CSS or using the instance method GMap#header_width_height)
#Outputs the <div id=...></div> which has been configured to contain the map. You can pass <tt>:width</tt> and <tt>:height</tt> as options to output this in the style attribute of the DIV element (you could also achieve the same effect by putting the dimension info into a CSS or using the instance method GMap#header_width_height). You can aslo pass <tt>:class</tt> to set the classname of the div.
def div(options = {})
attributes = "id=\"#{@container}\" "
if options.has_key?(:height) && options.has_key?(:width)
attributes += "style=\"width:#{options[:width]}px;height:#{options[:height]}px\""
attributes += "style=\"width:#{options[:width]}px;height:#{options[:height]}px\" "
end
if options.has_key?(:class)
attributes += "class=\"#{options[:class]}\" "
end
"<div #{attributes}></div>"
end
Expand Down

0 comments on commit 8ad3eae

Please sign in to comment.